diff --git a/examples/json-web-api/Cargo.toml b/examples/json-web-api/Cargo.toml index 66cb430e..c2b81d4f 100644 --- a/examples/json-web-api/Cargo.toml +++ b/examples/json-web-api/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] schemars = "0.7.0" okapi = { version = "0.4.0", path = "../../okapi" } -rocket_okapi = { version = "0.4.1", path = "../../rocket-okapi" } +rocket_okapi = { version = "0.5.0", path = "../../rocket-okapi" } rocket = { version = "0.4.3", default-features = false } serde = "1.0" diff --git a/rocket-okapi-codegen/Cargo.toml b/rocket-okapi-codegen/Cargo.toml index 602a5391..dc8666ed 100644 --- a/rocket-okapi-codegen/Cargo.toml +++ b/rocket-okapi-codegen/Cargo.toml @@ -2,7 +2,7 @@ name = "rocket_okapi_codegen" description = "Macros supporting rocket_okapi" repository = "https://github.com/GREsau/okapi" -version = "0.4.1" +version = "0.5.0" authors = ["Graham Esau "] edition = "2018" license = "MIT" diff --git a/rocket-okapi/Cargo.toml b/rocket-okapi/Cargo.toml index fec995f1..dd759350 100644 --- a/rocket-okapi/Cargo.toml +++ b/rocket-okapi/Cargo.toml @@ -2,7 +2,7 @@ name = "rocket_okapi" description = "OpenAPI (AKA Swagger) document generation for Rocket applications" repository = "https://github.com/GREsau/okapi" -version = "0.4.1" +version = "0.5.0" authors = ["Graham Esau "] edition = "2018" license = "MIT" @@ -11,7 +11,7 @@ keywords = ["rust", "openapi", "swagger", "rocket"] [dependencies] schemars = "0.7.0" okapi = { version = "0.4.0", path = "../okapi" } -rocket_okapi_codegen = { version = "=0.4.1", path = "../rocket-okapi-codegen" } +rocket_okapi_codegen = { version = "=0.5.0", path = "../rocket-okapi-codegen" } rocket = { version = "0.4.3", default-features = false } serde = "1.0" serde_json = "1.0" diff --git a/rocket-okapi/src/lib.rs b/rocket-okapi/src/lib.rs index cc00a412..93b01008 100644 --- a/rocket-okapi/src/lib.rs +++ b/rocket-okapi/src/lib.rs @@ -8,9 +8,9 @@ //! First, add the following lines to your `Cargo.toml` //! ```toml //! [dependencies] -//! rocket_okapi = "0.3" -//! schemars = "0.6" -//! okapi = { version = "0.3", features = ["derive_json_schema"] } +//! rocket_okapi = "0.5" +//! schemars = "0.7" +//! okapi = { version = "0.5", features = ["derive_json_schema"] } //! ``` //! To add documentation to a set of endpoints, a couple of steps are required. The request and //! response types of the endpoint must implement `JsonSchema`. Secondly, the function must be @@ -22,17 +22,17 @@ //! ### Example //! ```rust, no_run //! #![feature(decl_macro, proc_macro_hygiene)] -//! +//! //! use rocket::get; //! use rocket_contrib::json::Json; //! use rocket_okapi::{openapi, routes_with_openapi, JsonSchema}; //! use rocket_okapi::swagger_ui::{make_swagger_ui, SwaggerUIConfig}; -//! +//! //! #[derive(serde::Serialize, JsonSchema)] //! struct Response { //! reply: String, //! } -//! +//! //! #[openapi] //! #[get("/")] //! fn my_controller() -> Json { @@ -43,13 +43,13 @@ //! //! fn get_docs() -> SwaggerUIConfig { //! use rocket_okapi::swagger_ui::UrlObject; -//! +//! //! SwaggerUIConfig { //! url: "/my_resource/openapi.json".to_string(), //! urls: vec![UrlObject::new("My Resource", "/v1/company/openapi.json")], //! } //! } -//! +//! //! fn main() { //! rocket::ignite() //! .mount("/my_resource", routes_with_openapi![my_controller]) @@ -60,7 +60,7 @@ mod error; -/// Contains the `Generator` struct, which you can use to manually control the way a struct is +/// Contains the `Generator` struct, which you can use to manually control the way a struct is /// represented in the documentation. pub mod gen; /// Contains several `Rocket` `Handler`s, which are used for serving the json files and the swagger