88This crate works as a bridge between [ utoipa] ( https://docs.rs/utoipa/latest/utoipa/ ) and [ Redoc] ( https://redocly.com/ ) OpenAPI visualizer.
99
1010Utoipa-redoc provides simple mechanism to transform OpenAPI spec resource to a servable HTML
11- file which can be served via [ predefined framework integration] [ Self #examples] or used
12- [ standalone] [ Self #using-standalone] and served manually.
11+ file which can be served via [ predefined framework integration] ( #examples ) or used
12+ [ standalone] ( #using-standalone ) and served manually.
1313
1414You may find fullsize examples from utoipa's Github [ repository] [ examples ] .
1515
@@ -41,7 +41,7 @@ framework.
4141
4242` Redoc::to_html ` method can be used to convert the ` Redoc ` instance to a servable html
4343file.
44- ```
44+ ``` rust
4545let redoc = Redoc :: new (ApiDoc :: openapi ());
4646
4747// Then somewhere in your application that handles http operation.
@@ -54,7 +54,7 @@ let redoc_handler = move || async {
5454# Customization
5555
5656Utoipa-redoc enables full customizaton support for [ Redoc] [ redoc ] according to what can be
57- customized by modifying the HTML template and [ configuration options] [ Self #configuration] .
57+ customized by modifying the HTML template and [ configuration options] ( #configuration ) .
5858
5959The default [ HTML template] [ redoc_html_quickstart ] can be fully overridden to ones liking with
6060` Redoc::custom_html ` method. The HTML template ** must** contain ** ` $spec ` ** and ** ` $config ` **
@@ -120,15 +120,13 @@ _**Serve `Redoc` via `axum` framework.**_
120120
121121_ ** Use ` Redoc ` to serve OpenAPI spec from url.** _
122122``` rust
123- # use utoipa_redoc :: Redoc ;
124123Redoc :: new (
125124 " https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml" )
126125```
127126
128127_ ** Use ` Redoc ` to serve custom OpenAPI spec using serde's ` json!() ` macro.** _
129128``` rust
130- # use utoipa_redoc :: Redoc ;
131- Redoc :: new (json! ({" openapi" : 3.1 . 0 }));
129+ Redoc :: new (json! ({" openapi" : " 3.1.0" }));
132130```
133131
134132[ redoc ] : < https://redocly.com/ >
0 commit comments