make 'utoipa' an optional feature in 'utoipa-axum' #1337
woshilapin
started this conversation in
Ideas
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.
-
In the project I work on, we use
utoipato generate the OpenAPI file as a sub-command of the main application: it's not exposed anywhere in the webserver. But this sub-command is rarely modified. We mostly work on the web server part that don't need all theutoipaannotations, only theaxum::Routerpart. Therefore, we pay the price of code generation ofutoipa::ToSchemaandutoipa::pathon each and every compilation orrust-analyzeriteration, but we mostly need theaxum::Routerto be defined, not the entire OpenAPI schema.Would it make sense to make
utoipaa[feature](enabled by default) ofutoipa-axum? Is this a wild idea, or does it make sense?I've started looking around for how to technically realize this kind of thing... and if I understand correctly, that would not be trivial to implement. As far as I can understand, the
axum::Routeris based on the implementation ofutoipa::Pathon the handlers, which means that disablingutoipameans losing the necessary metadata to build the router. So I guess we would need an intermediate representation forOpenApiRouterthat doesn't depend onutoipadirectly. I'm taking any idea, hint, warning, I might try to explore that.And sorry if there was already a similar discussion/issue, I tried to find related topics but couldn't, for lack of good keywords ("optional", "feature"?).
Beta Was this translation helpful? Give feedback.
All reactions