From 5a1fa1fa3724158249ece9dbfb6f863c8abd0ae1 Mon Sep 17 00:00:00 2001 From: ranger-ross Date: Sun, 6 Oct 2024 17:18:37 +0900 Subject: [PATCH] Added missing flags to Rust generator documentation --- docs/generators/rust.md | 1 + .../org/openapitools/codegen/languages/RustClientCodegen.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/generators/rust.md b/docs/generators/rust.md index 3b72bcbadb40..96170e2bc0f5 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -31,6 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |supportMiddleware|If set, add support for reqwest-middleware. This option is for 'reqwest' and 'reqwest-trait' library only| |false| |supportMultipleResponses|If set, return type wraps an enum of all possible 2xx schemas. This option is for 'reqwest' and 'reqwest-trait' library only| |false| |supportTokenSource|If set, add support for google-cloud-token. This option is for 'reqwest' and 'reqwest-trait' library only and requires the 'supportAsync' option| |false| +|topLevelApiClient|Creates a top level `Api` trait and `ApiClient` struct that contain all Apis. This option is for 'reqwest-trait' library only| |false| |useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| |withAWSV4Signature|whether to include AWS v4 signature support| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 5ec7c7e5fc8c..fc3ecfdc9998 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -94,6 +94,7 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon public static final String PREFER_UNSIGNED_INT = "preferUnsignedInt"; public static final String BEST_FIT_INT = "bestFitInt"; public static final String AVOID_BOXED_MODELS = "avoidBoxedModels"; + public static final String TOP_LEVEL_API_CLIENT = "topLevelApiClient"; public static final String MOCKALL = "mockall"; @Setter protected String packageName = "openapi"; @@ -236,6 +237,8 @@ public RustClientCodegen() { .defaultValue(Boolean.FALSE.toString())); cliOptions.add(new CliOption(MOCKALL, "Adds `#[automock]` from the mockall crate to api traits. This option is for 'reqwest-trait' library only", SchemaTypeUtil.BOOLEAN_TYPE) .defaultValue(Boolean.FALSE.toString())); + cliOptions.add(new CliOption(TOP_LEVEL_API_CLIENT, "Creates a top level `Api` trait and `ApiClient` struct that contain all Apis. This option is for 'reqwest-trait' library only", SchemaTypeUtil.BOOLEAN_TYPE) + .defaultValue(Boolean.FALSE.toString())); supportedLibraries.put(HYPER_LIBRARY, "HTTP client: Hyper (v1.x)."); supportedLibraries.put(HYPER0X_LIBRARY, "HTTP client: Hyper (v0.x).");