Skip to content

Missing security_schemes in components in #[openapi(...)] attribute. #559

Answered by juhaku
flo-at asked this question in Q&A
Discussion options

You must be logged in to vote

Is this because security_schemes is more complex to handle in the macro?
The other two options (schemas and responses) are wrapped in a utoipa::openapi::RefOr, so I guess security_schemes being different here is the root of the prolem.

That is the reason. It is more complex in structure and would produce a macro definition that is not necessarily fun to write. Though this could be worked through to streamline it. Moreover security schema might be something that is going to be applied conditionally thus macro attribute would not make sense in such a case. Or it might include some fields that should be defined in some config file and currently OpenApi and other derive macros allow literal…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@flo-at
Comment options

@juhaku
Comment options

Answer selected by flo-at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants