Move operationId and tags from openapi_overrides to Spectacular
Before
class MyEndpoint(RetrieveAPIView):
openapi_overrides = {
"operationId": "CustomId",
"tags": ["elements"]
}
After
@extend_schema_view(
get=extend_schema(operation_id='CustomId', tags=['elements'])
)
class MyEndpoint(RetrieveAPIView):
For endpoints that have a def get(…):
method, add the @extend_schema
on it directly.
For endpoints that have multiple methods, adding @extend_schema(tags=['elements'])
to the class adds tags to every method at once.
A simple way to detect where changes are still required is to change the list of supported keys to get warnings in manage.py spectacular
.