Open jvacek opened 10 months ago
Due to the inherent complexities and generic nature of DRF error handling, we cannot provide that feature in a reasonable manner. If you want to have that information in the schema, you need to use @extend_schema
.
Is there a way that I can annotate my permission classes directly at least, without having to annotate all the views that use them? I did not find any such mention in the documentation.
No, because permission classes would be only a part of the solution.
You can however, save the common stuff and e.g. reuse the list of responses for example.
People also have customized the AutoSchema: https://github.com/tfranzel/drf-spectacular/issues/101#issuecomment-1069383391
you need to use @extend_schema
How do we use extend_schema
to document permissions?
I've got a couple
permissions.BasePermission
classes that have themessage
field set on them.It would be nice if these could be included under
403
in theresponses
list, with the messages in the examples.