Expand description

Provides implementations to serve Swagger UI.

While serving Swagger UI is framework independant. Uotipa implements the boiler plate for few frameworks.

Currently supported frameworks by boiler plate implementations:

  • actix-web

Examples

Serve Swagger UI with api doc via actix-web. 1

let _ = HttpServer::new(move || {
        App::new()
            .service(
                SwaggerUi::new("/swagger-ui/{_:.*}")
                    .with_url("/api-doc/openapi.json", ApiDoc::openapi()),
            )
    })
    .bind(format!("{}:{}", Ipv4Addr::UNSPECIFIED, 8989)).unwrap()
    .run();

  1. actix-web feature need to be enabled. 

Structs

Entry point for serving Swagger UI and api docs in application.

Rust type for Swagger UI url configuration object.