diff --git a/README.md b/README.md index ef2ad4e8..35dbc33b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Refer to the existing [examples](./examples) for building the "todo" app in the - **[axum](https://github.com/tokio-rs/axum)** - **[warp](https://github.com/seanmonstar/warp)** - **[tide](https://github.com/http-rs/tide)** -- **[rocket](https://github.com/SergioBenitez/Rocket)** (`0.4` and `0.5.0-rc3`) +- **[rocket](https://github.com/SergioBenitez/Rocket)** (`0.4` and `0.5`) All examples include a [Swagger-UI](https://github.com/swagger-api/swagger-ui) unless stated otherwise. diff --git a/examples/rocket-todo/Cargo.toml b/examples/rocket-todo/Cargo.toml index 5190adf2..8f5c10dd 100644 --- a/examples/rocket-todo/Cargo.toml +++ b/examples/rocket-todo/Cargo.toml @@ -9,7 +9,7 @@ authors = ["Elli Example "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rocket = { version = "0.5.0-rc.3", features = ["json"] } +rocket = { version = "0.5", features = ["json"] } utoipa = { path = "../../utoipa", features = ["rocket_extras"] } utoipa-swagger-ui = { path = "../../utoipa-swagger-ui", features = ["rocket"] } utoipa-redoc = { path = "../../utoipa-redoc", features = ["rocket"] } diff --git a/examples/rocket-todo/src/main.rs b/examples/rocket-todo/src/main.rs index 7b4d2b1d..3ae2e3e7 100644 --- a/examples/rocket-todo/src/main.rs +++ b/examples/rocket-todo/src/main.rs @@ -55,10 +55,7 @@ fn rocket() -> Rocket { ) // There is no need to create RapiDoc::with_openapi because the OpenApi is served // via SwaggerUi instead we only make rapidoc to point to the existing doc. - .mount( - "/", - RapiDoc::new("/api-docs/openapi.json").path("/rapidoc") - ) + .mount("/", RapiDoc::new("/api-docs/openapi.json").path("/rapidoc")) // Alternative to above // .mount( // "/", @@ -127,11 +124,11 @@ mod todo { async fn from_request(request: &'r Request<'_>) -> request::Outcome { match request.headers().get("todo_apikey").next() { Some(key) if key == "utoipa-rocks" => Outcome::Success(RequireApiKey), - None => Outcome::Failure(( + None => Outcome::Error(( Status::Unauthorized, TodoError::Unauthorized(String::from("missing api key")), )), - _ => Outcome::Failure(( + _ => Outcome::Error(( Status::Unauthorized, TodoError::Unauthorized(String::from("invalid api key")), )), @@ -153,7 +150,7 @@ mod todo { } _ => { log::info!("no api key"); - Outcome::Forward(()) + Outcome::Forward(Status::Unauthorized) } } } diff --git a/utoipa-gen/Cargo.toml b/utoipa-gen/Cargo.toml index 5f51c520..a0314a01 100644 --- a/utoipa-gen/Cargo.toml +++ b/utoipa-gen/Cargo.toml @@ -29,7 +29,7 @@ serde = "1" actix-web = { version = "4", features = ["macros"], default-features = false } axum = "0.7" paste = "1" -rocket = { version = "0.5.0-rc.3", features = ["json"] } +rocket = { version = "0.5", features = ["json"] } smallvec = { version = "1.10", features = ["serde"] } rust_decimal = "1" chrono = { version = "0.4", features = ["serde"] } diff --git a/utoipa-rapidoc/Cargo.toml b/utoipa-rapidoc/Cargo.toml index 153a5c55..36226b64 100644 --- a/utoipa-rapidoc/Cargo.toml +++ b/utoipa-rapidoc/Cargo.toml @@ -19,5 +19,5 @@ serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0" } utoipa = { version = "4", path = "../utoipa" } actix-web = { version = "4", optional = true, default-features = false } -rocket = { version = "0.5.0-rc.3", features = ["json"], optional = true } +rocket = { version = "0.5", features = ["json"], optional = true } axum = { version = "0.7", optional = true } diff --git a/utoipa-rapidoc/README.md b/utoipa-rapidoc/README.md index 9701cdd9..4e50e47e 100644 --- a/utoipa-rapidoc/README.md +++ b/utoipa-rapidoc/README.md @@ -16,7 +16,7 @@ You may find fullsize examples from utoipa's Github [repository][examples]. # Crate Features * **actix-web** Allows serving `RapiDoc` via _**`actix-web`**_. `version >= 4` -* **rocket** Allows serving `RapiDoc` via _**`rocket`**_. `version >=0.5.0-rc.3` +* **rocket** Allows serving `RapiDoc` via _**`rocket`**_. `version >=0.5` * **axum** Allows serving `RapiDoc` via _**`axum`**_. `version >=0.7` # Install diff --git a/utoipa-redoc/Cargo.toml b/utoipa-redoc/Cargo.toml index 83fd30e4..df07b011 100644 --- a/utoipa-redoc/Cargo.toml +++ b/utoipa-redoc/Cargo.toml @@ -19,5 +19,5 @@ serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0" } utoipa = { version = "4", path = "../utoipa" } actix-web = { version = "4", optional = true, default-features = false } -rocket = { version = "0.5.0-rc.3", features = ["json"], optional = true } +rocket = { version = "0.5", features = ["json"], optional = true } axum = { version = "0.7", optional = true } diff --git a/utoipa-redoc/README.md b/utoipa-redoc/README.md index 23e8495a..0dfbf320 100644 --- a/utoipa-redoc/README.md +++ b/utoipa-redoc/README.md @@ -16,7 +16,7 @@ You may find fullsize examples from utoipa's Github [repository][examples]. # Crate Features * **actix-web** Allows serving `Redoc` via _**`actix-web`**_. `version >= 4` -* **rocket** Allows serving `Redoc` via _**`rocket`**_. `version >=0.5.0-rc.3` +* **rocket** Allows serving `Redoc` via _**`rocket`**_. `version >=0.5` * **axum** Allows serving `Redoc` via _**`axum`**_. `version >=0.7` # Install diff --git a/utoipa-swagger-ui/Cargo.toml b/utoipa-swagger-ui/Cargo.toml index fb451c96..a18edbcb 100644 --- a/utoipa-swagger-ui/Cargo.toml +++ b/utoipa-swagger-ui/Cargo.toml @@ -18,7 +18,7 @@ debug-embed = ["rust-embed/debug-embed"] rust-embed = { version = "8", features = ["interpolate-folder-path"] } mime_guess = { version = "2.0" } actix-web = { version = "4", optional = true, default-features = false } -rocket = { version = "0.5.0-rc.3", features = ["json"], optional = true } +rocket = { version = "0.5", features = ["json"], optional = true } axum = { version = "0.7", optional = true } utoipa = { version = "4", path = "../utoipa" } serde = { version = "1.0", features = ["derive"] } diff --git a/utoipa-swagger-ui/README.md b/utoipa-swagger-ui/README.md index cc069150..2e5e5e88 100644 --- a/utoipa-swagger-ui/README.md +++ b/utoipa-swagger-ui/README.md @@ -12,7 +12,7 @@ works as a bridge for serving the OpenAPI documentation created with **Currently implemented boilerplate for:** * **actix-web** `version >= 4` -* **rocket** `version >=0.5.0-rc.3` +* **rocket** `version >=0.5` * **axum** `version >=0.7` Serving Swagger UI is framework independent thus this crate also supports serving the Swagger UI with diff --git a/utoipa-swagger-ui/src/lib.rs b/utoipa-swagger-ui/src/lib.rs index 1ad06339..29f125f9 100644 --- a/utoipa-swagger-ui/src/lib.rs +++ b/utoipa-swagger-ui/src/lib.rs @@ -8,7 +8,7 @@ //! **Currently implemented boiler plate for:** //! //! * **actix-web** `version >= 4` -//! * **rocket** `version >=0.5.0-rc.3` +//! * **rocket** `version >=0.5` //! * **axum** `version >=0.6` //! //! Serving Swagger UI is framework independent thus this crate also supports serving the Swagger UI with