17 lines
586 B
Python
17 lines
586 B
Python
from django.utils.translation import gettext_lazy as _
|
|
from drf_spectacular.utils import extend_schema
|
|
from rest_framework import status
|
|
|
|
from engine.core.docs.drf import BASE_ERRORS
|
|
from engine.blog.serializers import PostSerializer
|
|
|
|
POST_SCHEMA = {
|
|
"list": extend_schema(
|
|
summary=_("list all posts (read-only)"),
|
|
responses={status.HTTP_200_OK: PostSerializer(many=True), **BASE_ERRORS},
|
|
),
|
|
"retrieve": extend_schema(
|
|
summary=_("retrieve a single post (read-only)"),
|
|
responses={status.HTTP_200_OK: PostSerializer(), **BASE_ERRORS},
|
|
),
|
|
}
|