diff --git a/README.md b/README.md index e8f26f6..92b7b33 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,19 @@ Similarly if there is a `format` field set to `uuid`: ```diff [dependencies] -+uuid = { version = "0.8", features = ["serde", "v4"] } ++uuid = { version = "1.0.0", features = ["serde", "v4"] } +``` + +The macro has some additional fancy options to control the generated code: + +```rust +generate_api!( + spec = "path/to/openapi_document.json", // The OpenAPI document + inner_type = my_client::InnerType, // Client inner type available to pre and post hooks + pre_hook = closure::or::path::to::function, // Hook invoked before issuing the HTTP request + post_hook = closure::or::path::to::function, // Hook invoked prior to receiving the HTTP response + derives = [ schemars::JsonSchema ], // Additional derive macros applied to generated types +); ``` Note that the macro will be re-evaluated when the OpenAPI json document @@ -135,7 +147,7 @@ percent-encoding = "2.1" reqwest = { version = "0.11", features = ["json", "stream"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -uuid = { version = "0.8", features = ["serde", "v4"] } +uuid = { version = ">=0.8.0, <2.0.0", features = ["serde", "v4"] } ``` Note that there is a dependency on `percent-encoding` which macro- and diff --git a/progenitor-impl/src/lib.rs b/progenitor-impl/src/lib.rs index 7550e17..a2a8d39 100644 --- a/progenitor-impl/src/lib.rs +++ b/progenitor-impl/src/lib.rs @@ -210,7 +210,7 @@ impl Generator { ]; if self.type_space.uses_uuid() { deps.push( - "uuid = { version = \"0.8\", features = [\"serde\", \"v4\"] }", + "uuid = { version = \">=0.8.0, <2.0.0\", features = [\"serde\", \"v4\"] }", ) } if self.type_space.uses_chrono() { diff --git a/progenitor-macro/src/lib.rs b/progenitor-macro/src/lib.rs index 2ffdfe3..328441b 100644 --- a/progenitor-macro/src/lib.rs +++ b/progenitor-macro/src/lib.rs @@ -21,7 +21,7 @@ use syn::LitStr; /// The more complex form accepts the following key-value pairs in any order: /// ```ignore /// generate_api!( -/// spec = "path/to/spec.json" +/// spec = "path/to/spec.json", /// [ inner_type = path::to:Type, ] /// [ pre_hook = closure::or::path::to::function, ] /// [ post_hook = closure::or::path::to::function, ]