Add custom field to generated OpenAPI spec from middleware? #866
Unanswered
Jtcruthers
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a role-based access control middleware that I add to operations. Technically, it's a function I pass a list of roles to that returns a middleware that checks the context for one of the required roles, and returns a 403 if it doesn't exist, otherwise call next.
I would like to add a field to the OpenAPI spec stating what roles are required for each endpoint. Is there a way to add it from that middleware? If not, is there a way to add that to the spec manually for each operation? I can't figure out how to do either
Beta Was this translation helpful? Give feedback.
All reactions