You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by TitanNano November 19, 2022
We started to build our public API with axum and utoipa and are already facing the issue that we discover miss matches between the API spec and the actual implementation in axum.
Examples for this are, route path does not match utoipa path or method does not match utoipa path. For this reason, I started looking into what is being generated for the OpenAPI spec and how we could use that to avoid the drift between implementation and documentation.
What I found is quite nice, we can access the entire APS spec and extract all paths and methods from it to build our router. I discovered only two issues that block us from doing this, though:
there is no way of getting from the API spec to the correct handler function for axum. There is the operation id which by default matches the handler function name and with some macro magic, I might be able to locate the correct function, but I do not want to expose such an implementation detail in our public API spec. We would be depending on the operation id always matching the function name.
We are currently using route layer extensions to inject dependencies into our route handlers, and we will need some way of associating them with the path definition.
The text was updated successfully, but these errors were encountered:
Discussed in #355
Originally posted by TitanNano November 19, 2022
We started to build our public API with
axum
andutoipa
and are already facing the issue that we discover miss matches between the API spec and the actual implementation in axum.Examples for this are,
route
path does not matchutoipa
path or method does not matchutoipa
path. For this reason, I started looking into what is being generated for the OpenAPI spec and how we could use that to avoid the drift between implementation and documentation.What I found is quite nice, we can access the entire APS spec and extract all paths and methods from it to build our router. I discovered only two issues that block us from doing this, though:
The text was updated successfully, but these errors were encountered: