utoipa icon indicating copy to clipboard operation
utoipa copied to clipboard

Is there way to serve swagger ui from swagger file?

Open Kavan72 opened this issue 2 years ago • 1 comments

I'm looking to just serve swagger ui from swagger.yaml, is there way i can do this ? for java we are using springdoc-openapi on this we have option to enable this.

Kavan72 avatar Apr 26 '23 18:04 Kavan72

Yes there is if you are using rocket, axum or actix_web otherwise it is manual procedure. You can use this to expose external openapi spec. https://docs.rs/utoipa-swagger-ui/latest/utoipa_swagger_ui/struct.SwaggerUi.html#method.external_url_unchecked

Note that there is no currently way to serve openapi spec directly from file.

juhaku avatar Apr 26 '23 18:04 juhaku