Skip to content

Swagger-Ui file disappears after deploy #1261

Answered by juhaku
Kimishu asked this question in Q&A
Discussion options

You must be logged in to vote

So you cannot see Swagger UI after you have build the docker container? utoipa-swagger-ui uses rust-embed to embed the Swagger UI files into the binary. The rust-embed does not embed files on debug build to the binary. Instead you need to either build the project with --release flag or enabled debug-embed feature. https://github.com/juhaku/utoipa?tab=readme-ov-file#swagger-ui-returns-404-notfound-from-built-binary

Here is an example with Docker: https://github.com/juhaku/utoipa/tree/master/examples/axum-utoipa-nesting-vendored

Here you can find the utoipa-swagger-ui feature flags: https://github.com/juhaku/utoipa/tree/master/utoipa-swagger-ui#crate-features

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kimishu
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