diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 7bf579c76fb..92030ec6913 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -52,7 +52,6 @@ import org.openapitools.codegen.api.TemplatingEngineAdapter; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.examples.ExampleGenerator; import org.openapitools.codegen.languages.PhpNextgenClientCodegen; -import org.openapitools.codegen.languages.RustAxumServerCodegen; import org.openapitools.codegen.languages.RustServerCodegen; import org.openapitools.codegen.meta.FeatureSet; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -707,7 +706,7 @@ public class DefaultCodegen implements CodegenConfig { * Removes importToRemove from the imports of objs, if present. * This is useful to remove imports that are already present in operations-related template files, to avoid importing the same thing twice. * - * @param objs imports will be removed from this objs' imports collection + * @param objs imports will be removed from this objs' imports collection * @param importToRemove the import statement to be removed */ protected void removeImport(OperationsMap objs, String importToRemove) { @@ -2302,7 +2301,7 @@ public class DefaultCodegen implements CodegenConfig { * Any non-null value will cause {{#defaultValue} check to pass. * * @param codegenProperty Codegen Property - * @param schema Parameter schema + * @param schema Parameter schema * @return string presentation of the default value of the parameter */ public String toDefaultParameterValue(CodegenProperty codegenProperty, Schema schema) { @@ -2329,7 +2328,7 @@ public class DefaultCodegen implements CodegenConfig { * Return null if you do NOT want a default value. * Any non-null value will cause {{#defaultValue} check to pass. * - * @param schema Property schema + * @param schema Property schema * @param codegenProperty Codegen property * @return string presentation of the default value of the property */ @@ -2372,7 +2371,6 @@ public class DefaultCodegen implements CodegenConfig { } - protected Schema getSchemaAdditionalProperties(Schema schema) { Schema inner = ModelUtils.getAdditionalProperties(schema); if (inner == null) { @@ -3009,6 +3007,7 @@ public class DefaultCodegen implements CodegenConfig { /** * A method that allows generators to pre-process test example payloads * This can be useful if one needs to change how values like null in string are represented + * * @param data the test data payload * @return the updated test data payload */ @@ -3019,6 +3018,7 @@ public class DefaultCodegen implements CodegenConfig { /** * Processes any test cases if they exist in the components.x-test-examples vendor extensions * If they exist then cast them to java class instances and return them back in a map + * * @param refToTestCases the component schema name that the test cases are for */ private HashMap extractSchemaTestCases(String refToTestCases) { @@ -3055,7 +3055,7 @@ public class DefaultCodegen implements CodegenConfig { /** * Sets the booleans that define the model's type * - * @param model the model to update + * @param model the model to update * @param schema the model's schema */ protected void updateModelForString(CodegenModel model, Schema schema) { @@ -3313,7 +3313,6 @@ public class DefaultCodegen implements CodegenConfig { * @param sc The Schema that may contain the discriminator * @param discPropName The String that is the discriminator propertyName in the schema * @param visitedSchemas A set of visited schema names - * */ private CodegenProperty discriminatorFound(String composedSchemaName, Schema sc, String discPropName, Set visitedSchemas) { if (visitedSchemas.contains(composedSchemaName)) { // recursive schema definition found @@ -3400,7 +3399,7 @@ public class DefaultCodegen implements CodegenConfig { /** * Recursively look in Schema sc for the discriminator and return it * - * @param sc The Schema that may contain the discriminator + * @param sc The Schema that may contain the discriminator * @param visitedSchemas An array list of visited schemas */ private Discriminator recursiveGetDiscriminator(Schema sc, ArrayList visitedSchemas) { @@ -3620,9 +3619,9 @@ public class DefaultCodegen implements CodegenConfig { Map vendorExtensions = cs.getExtensions(); String mappingName = Optional.ofNullable(vendorExtensions) - .map(ve -> ve.get("x-discriminator-value")) - .map(discriminatorValue -> (String) discriminatorValue) - .orElse(currentSchemaName); + .map(ve -> ve.get("x-discriminator-value")) + .map(discriminatorValue -> (String) discriminatorValue) + .orElse(currentSchemaName); MappedModel mm = new MappedModel(mappingName, toModelName(currentSchemaName), !mappingName.equals(currentSchemaName)); descendentSchemas.add(mm); } @@ -3649,11 +3648,11 @@ public class DefaultCodegen implements CodegenConfig { // the future.. String propertyType = Optional.ofNullable(schema.getProperties()) - .map(p -> (Schema) p.get(discriminatorPropertyName)) - .map(Schema::get$ref) - .map(ModelUtils::getSimpleRef) - .map(this::toModelName) - .orElseGet(() -> typeMapping.get("string")); + .map(p -> (Schema) p.get(discriminatorPropertyName)) + .map(Schema::get$ref) + .map(ModelUtils::getSimpleRef) + .map(this::toModelName) + .orElseGet(() -> typeMapping.get("string")); discriminator.setPropertyType(propertyType); // check to see if the discriminator property is an enum string @@ -3944,8 +3943,8 @@ public class DefaultCodegen implements CodegenConfig { * This method was kept when required was added to the fromProperty signature * to ensure that the change was non-breaking * - * @param name name of the property - * @param p OAS property schema + * @param name name of the property + * @param p OAS property schema * @return Codegen Property object */ public CodegenProperty fromProperty(String name, Schema p) { @@ -3961,9 +3960,9 @@ public class DefaultCodegen implements CodegenConfig { * Any subsequent processing of the CodegenModel return value must be idempotent * for a given (String name, Schema schema). * - * @param name name of the property - * @param p OAS property schema - * @param required true if the property is required in the next higher object schema, false otherwise + * @param name name of the property + * @param p OAS property schema + * @param required true if the property is required in the next higher object schema, false otherwise * @param schemaIsFromAdditionalProperties true if the property is a required property defined by additional properties schema * If this is the actual additionalProperties schema not defining a required property, then * the value should be false @@ -4742,7 +4741,7 @@ public class DefaultCodegen implements CodegenConfig { if (contentType != null) { contentType = contentType.toLowerCase(Locale.ROOT); } - if (!(this instanceof RustAxumServerCodegen) && contentType != null && + if (contentType != null && (contentType.startsWith("application/x-www-form-urlencoded") || contentType.startsWith("multipart"))) { // process form parameters @@ -5909,10 +5908,10 @@ public class DefaultCodegen implements CodegenConfig { /** * Add the model name of the child schema in a composed schema to the set of imports * - * @param composed composed schema + * @param composed composed schema * @param childSchema composed schema - * @param model codegen model - * @param modelName model name + * @param model codegen model + * @param modelName model name */ protected void addImport(Schema composed, Schema childSchema, CodegenModel model, String modelName) { if (composed == null || childSchema == null) { @@ -6795,12 +6794,12 @@ public class DefaultCodegen implements CodegenConfig { String enumValue = isDataTypeString(dataType) ? enumUnknownDefaultCaseName : // This is a dummy value that attempts to avoid collisions with previously specified cases. - // Int.max / 192 - // The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // Since this functionality was born in the Swift 5 generator and latter on broth to all generators - // https://github.com/OpenAPITools/openapi-generator/pull/11013 - String.valueOf(11184809); + // Int.max / 192 + // The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums. + // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) + // Since this functionality was born in the Swift 5 generator and latter on broth to all generators + // https://github.com/OpenAPITools/openapi-generator/pull/11013 + String.valueOf(11184809); enumVar.put("name", toEnumVarName(enumName, dataType)); enumVar.put("value", toEnumValue(enumValue, dataType)); @@ -7984,6 +7983,7 @@ public class DefaultCodegen implements CodegenConfig { protected String getAdditionalPropertiesName() { return "additional_properties"; } + private void addJsonSchemaForBodyRequestInCaseItsNotPresent(CodegenParameter codegenParameter, RequestBody body) { if (codegenParameter.jsonSchema == null) codegenParameter.jsonSchema = Json.pretty(body); @@ -8250,8 +8250,8 @@ public class DefaultCodegen implements CodegenConfig { /** * Add a given ComposedSchema as an interface model to be generated, assuming it has `oneOf` defined * - * @param cs ComposedSchema object to create as interface model - * @param type name to use for the generated interface model + * @param cs ComposedSchema object to create as interface model + * @param type name to use for the generated interface model */ public void addOneOfInterfaceModel(Schema cs, String type) { if (cs.getOneOf() == null) { @@ -8441,7 +8441,7 @@ public class DefaultCodegen implements CodegenConfig { // in other sub-schemas of allOf/anyOf/oneOf cp.vendorExtensions.putIfAbsent("x-duplicated-data-type", true); } else { - if(isTypeErasedGenerics()) { + if (isTypeErasedGenerics()) { dataTypeSet.add(cp.baseType); } else { dataTypeSet.add(cp.dataType); @@ -8472,10 +8472,14 @@ public class DefaultCodegen implements CodegenConfig { } @Override - public boolean getUseInlineModelResolver() { return true; } + public boolean getUseInlineModelResolver() { + return true; + } @Override - public boolean getUseOpenapiNormalizer() { return true; } + public boolean getUseOpenapiNormalizer() { + return true; + } @Override public Set getOpenapiGeneratorIgnoreList() { @@ -8492,7 +8496,9 @@ public class DefaultCodegen implements CodegenConfig { And convert special characters like newline, tab, carriage return Into strings that can be rendered in the language that the generator will output to */ - protected String handleSpecialCharacters(String name) { return name; } + protected String handleSpecialCharacters(String name) { + return name; + } /** * Used to ensure that null or Schema is returned given an input Boolean/Schema/null diff --git a/modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache index d313de7116b..47bdeba6b61 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache @@ -42,7 +42,7 @@ conversion = [ async-trait = "0.1" axum = { version = "0.7" } axum-extra = { version = "0.9", features = ["cookie", "multipart"] } -base64 = "0.21" +base64 = "0.22" bytes = "1" chrono = { version = "0.4", features = ["serde"] } frunk = { version = "0.4", optional = true } @@ -62,7 +62,7 @@ tokio = { version = "1", default-features = false, features = [ ] } tracing = { version = "0.1", features = ["attributes"] } uuid = { version = "1", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } +validator = { version = "0.18", features = ["derive"] } [dev-dependencies] tracing-subscriber = "0.3" diff --git a/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache b/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache index ef07e5afa96..d96088f86a4 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache @@ -1,5 +1,13 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow( + missing_docs, + trivial_casts, + unused_variables, + unused_mut, + unused_extern_crates, + non_camel_case_types, + unused_imports, + unused_attributes +)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/modules/openapi-generator/src/main/resources/rust-axum/models.mustache b/modules/openapi-generator/src/main/resources/rust-axum/models.mustache index f4760d0a9b7..44ed4ed6bf4 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/models.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/models.mustache @@ -36,10 +36,10 @@ use crate::{models, types::*}; {{/maxLength}} {{#pattern}} {{^isByteArray}} - regex = "RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.uppercase}}", + regex(path = *RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.uppercase}}), {{/isByteArray}} {{#isByteArray}} - custom ="validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.lowercase}}" + custom(function = "validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}HeaderParams_{{{paramName}}}{{/lambda.lowercase}}"), {{/isByteArray}} {{/pattern}} {{#maximum}} @@ -128,10 +128,10 @@ use crate::{models, types::*}; {{/maxLength}} {{#pattern}} {{^isByteArray}} - regex = "RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.uppercase}}", + regex(path = *RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.uppercase}}), {{/isByteArray}} {{#isByteArray}} - custom ="validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.lowercase}}" + custom(function = "validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}PathParams_{{{paramName}}}{{/lambda.lowercase}}"), {{/isByteArray}} {{/pattern}} {{#maximum}} @@ -232,10 +232,10 @@ use crate::{models, types::*}; {{/maxLength}} {{#pattern}} {{^isByteArray}} - regex = "RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.uppercase}}", + regex(path = *RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.uppercase}}), {{/isByteArray}} {{#isByteArray}} - custom ="validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.lowercase}}" + custom(function = "validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}QueryParams_{{{paramName}}}{{/lambda.lowercase}}"), {{/isByteArray}} {{/pattern}} {{#maximum}} @@ -639,10 +639,10 @@ pub struct {{{classname}}} { {{/maxLength}} {{#pattern}} {{^isByteArray}} - regex = "RE_{{#lambda.uppercase}}{{{classname}}}_{{{name}}}{{/lambda.uppercase}}", + regex(path = *RE_{{#lambda.uppercase}}{{{classname}}}_{{{name}}}{{/lambda.uppercase}}), {{/isByteArray}} {{#isByteArray}} - custom ="validate_byte_{{#lambda.lowercase}}{{{classname}}}_{{{name}}}{{/lambda.lowercase}}" + custom(function = "validate_byte_{{#lambda.lowercase}}{{{classname}}}_{{{name}}}{{/lambda.lowercase}}"), {{/isByteArray}} {{/pattern}} {{#maximum}} diff --git a/modules/openapi-generator/src/main/resources/rust-axum/server-operation-validate.mustache b/modules/openapi-generator/src/main/resources/rust-axum/server-operation-validate.mustache index 6bacec90170..54a0ab28e35 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/server-operation-validate.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/server-operation-validate.mustache @@ -22,10 +22,10 @@ {{/maxLength}} {{#pattern}} {{#isString}} - regex = "RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.uppercase}}", + regex(path = *RE_{{#lambda.uppercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.uppercase}}), {{/isString}} {{^isString}} - custom ="validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.lowercase}}", + custom(function = "validate_byte_{{#lambda.lowercase}}{{{operationIdCamelCase}}}BodyValidator{{/lambda.lowercase}}"), {{/isString}} {{/pattern}} {{#maximum}} @@ -59,7 +59,7 @@ {{^x-consumes-plain-text}} {{^hasValidation}} {{^isMap}} - #[validate] + #[validate(nested)] {{/isMap}} {{/hasValidation}} body: &'a {{{dataType}}}, @@ -218,4 +218,4 @@ Ok(( {{/x-consumes-multipart}} {{/x-consumes-multipart-related}} )) -} +} \ No newline at end of file diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION index c9e125ba188..08bfd0643b8 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0-SNAPSHOT +7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/Cargo.toml b/samples/server/petstore/rust-axum/output/multipart-v3/Cargo.toml index 9b554d7ce5f..1d9f505db10 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/multipart-v3/Cargo.toml @@ -20,7 +20,7 @@ conversion = [ async-trait = "0.1" axum = { version = "0.7" } axum-extra = { version = "0.9", features = ["cookie", "multipart"] } -base64 = "0.21" +base64 = "0.22" bytes = "1" chrono = { version = "0.4", features = ["serde"] } frunk = { version = "0.4", optional = true } @@ -40,7 +40,7 @@ tokio = { version = "1", default-features = false, features = [ ] } tracing = { version = "0.1", features = ["attributes"] } uuid = { version = "1", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } +validator = { version = "0.18", features = ["derive"] } [dev-dependencies] tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/README.md b/samples/server/petstore/rust-axum/output/multipart-v3/README.md index d7e08f99cb3..f4f456c04bd 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/README.md +++ b/samples/server/petstore/rust-axum/output/multipart-v3/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0.7 - +- Generator version: 7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs index ad0edc3812e..f34355edde0 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs @@ -3,11 +3,11 @@ trivial_casts, unused_variables, unused_mut, - unused_imports, unused_extern_crates, - non_camel_case_types + non_camel_case_types, + unused_imports, + unused_attributes )] -#![allow(unused_imports, unused_attributes)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs index b1dc6929757..ea53d41e0e8 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs @@ -41,7 +41,6 @@ where fn multipart_related_request_post_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// MultipartRelatedRequestPost - POST /multipart_related_request #[tracing::instrument(skip_all)] async fn multipart_related_request_post( @@ -99,7 +98,6 @@ where fn multipart_request_post_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// MultipartRequestPost - POST /multipart_request #[tracing::instrument(skip_all)] async fn multipart_request_post( @@ -156,7 +154,6 @@ where fn multiple_identical_mime_types_post_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// MultipleIdenticalMimeTypesPost - POST /multiple-identical-mime-types #[tracing::instrument(skip_all)] async fn multiple_identical_mime_types_post( diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION index c9e125ba188..08bfd0643b8 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0-SNAPSHOT +7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/Cargo.toml b/samples/server/petstore/rust-axum/output/openapi-v3/Cargo.toml index 0c2cd974058..5ffc5cd9405 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/openapi-v3/Cargo.toml @@ -20,7 +20,7 @@ conversion = [ async-trait = "0.1" axum = { version = "0.7" } axum-extra = { version = "0.9", features = ["cookie", "multipart"] } -base64 = "0.21" +base64 = "0.22" bytes = "1" chrono = { version = "0.4", features = ["serde"] } frunk = { version = "0.4", optional = true } @@ -40,7 +40,7 @@ tokio = { version = "1", default-features = false, features = [ ] } tracing = { version = "0.1", features = ["attributes"] } uuid = { version = "1", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } +validator = { version = "0.18", features = ["derive"] } [dev-dependencies] tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/README.md b/samples/server/petstore/rust-axum/output/openapi-v3/README.md index 7343a6f0ef3..cce3ce70309 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/README.md +++ b/samples/server/petstore/rust-axum/output/openapi-v3/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0.7 - +- Generator version: 7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs index a86c406ffee..999fa523c36 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs @@ -3,11 +3,11 @@ trivial_casts, unused_variables, unused_mut, - unused_imports, unused_extern_crates, - non_camel_case_types + non_camel_case_types, + unused_imports, + unused_attributes )] -#![allow(unused_imports, unused_attributes)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs index b471568f253..77ff323cab4 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs @@ -96,7 +96,6 @@ fn any_of_get_validation( Ok((query_params,)) } - /// AnyOfGet - GET /any-of #[tracing::instrument(skip_all)] async fn any_of_get( @@ -219,7 +218,6 @@ fn callback_with_header_post_validation( Ok((query_params,)) } - /// CallbackWithHeaderPost - POST /callback-with-header #[tracing::instrument(skip_all)] async fn callback_with_header_post( @@ -277,7 +275,6 @@ fn complex_query_param_get_validation( Ok((query_params,)) } - /// ComplexQueryParamGet - GET /complex-query-param #[tracing::instrument(skip_all)] async fn complex_query_param_get( @@ -335,7 +332,6 @@ fn enum_in_path_path_param_get_validation( Ok((path_params,)) } - /// EnumInPathPathParamGet - GET /enum_in_path/{path_param} #[tracing::instrument(skip_all)] async fn enum_in_path_path_param_get( @@ -393,7 +389,6 @@ fn json_complex_query_param_get_validation( Ok((query_params,)) } - /// JsonComplexQueryParamGet - GET /json-complex-query-param #[tracing::instrument(skip_all)] async fn json_complex_query_param_get( @@ -451,7 +446,6 @@ fn mandatory_request_header_get_validation( Ok((header_params,)) } - /// MandatoryRequestHeaderGet - GET /mandatory-request-header #[tracing::instrument(skip_all)] async fn mandatory_request_header_get( @@ -467,7 +461,7 @@ where { // Header parameters let header_params = { - let header_x_header = headers.get(HeaderName::from_static("x-header")); + let header_x_header = headers.get(HeaderName::from_static("x_header")); let header_x_header = match header_x_header { Some(v) => match header::IntoHeaderValue::::try_from((*v).clone()) { @@ -538,7 +532,6 @@ where fn merge_patch_json_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// MergePatchJsonGet - GET /merge-patch-json #[tracing::instrument(skip_all)] async fn merge_patch_json_get( @@ -610,7 +603,6 @@ where fn multiget_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// MultigetGet - GET /multiget #[tracing::instrument(skip_all)] async fn multiget_get( @@ -796,7 +788,6 @@ where fn multiple_auth_scheme_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// MultipleAuthSchemeGet - GET /multiple_auth_scheme #[tracing::instrument(skip_all)] async fn multiple_auth_scheme_get( @@ -851,7 +842,6 @@ where fn one_of_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// OneOfGet - GET /one-of #[tracing::instrument(skip_all)] async fn one_of_get( @@ -920,7 +910,6 @@ where fn override_server_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// OverrideServerGet - GET /override-server #[tracing::instrument(skip_all)] async fn override_server_get( @@ -977,7 +966,6 @@ fn paramget_get_validation( Ok((query_params,)) } - /// ParamgetGet - GET /paramget #[tracing::instrument(skip_all)] async fn paramget_get( @@ -1050,7 +1038,6 @@ where fn readonly_auth_scheme_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// ReadonlyAuthSchemeGet - GET /readonly_auth_scheme #[tracing::instrument(skip_all)] async fn readonly_auth_scheme_get( @@ -1109,7 +1096,6 @@ fn register_callback_post_validation( Ok((query_params,)) } - /// RegisterCallbackPost - POST /register-callback #[tracing::instrument(skip_all)] async fn register_callback_post( @@ -1171,7 +1157,6 @@ fn required_octet_stream_put_validation( ) -> std::result::Result<(Bytes,), ValidationErrors> { Ok((body,)) } - /// RequiredOctetStreamPut - PUT /required_octet_stream #[tracing::instrument(skip_all)] async fn required_octet_stream_put( @@ -1225,7 +1210,6 @@ where fn responses_with_headers_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// ResponsesWithHeadersGet - GET /responses_with_headers #[tracing::instrument(skip_all)] async fn responses_with_headers_get( @@ -1273,7 +1257,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers.insert(HeaderName::from_static("success-info"), success_info); + response_headers.insert(HeaderName::from_static(""), success_info); } if let Some(bool_header) = bool_header { let bool_header = match header::IntoHeaderValue(bool_header).try_into() { @@ -1287,8 +1271,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers - .insert(HeaderName::from_static("bool-header"), bool_header); + response_headers.insert(HeaderName::from_static(""), bool_header); } } if let Some(object_header) = object_header { @@ -1303,8 +1286,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers - .insert(HeaderName::from_static("object-header"), object_header); + response_headers.insert(HeaderName::from_static(""), object_header); } } @@ -1346,8 +1328,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers - .insert(HeaderName::from_static("further-info"), further_info); + response_headers.insert(HeaderName::from_static(""), further_info); } } if let Some(failure_info) = failure_info { @@ -1362,8 +1343,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers - .insert(HeaderName::from_static("failure-info"), failure_info); + response_headers.insert(HeaderName::from_static(""), failure_info); } } @@ -1388,7 +1368,6 @@ where fn rfc7807_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Rfc7807Get - GET /rfc7807 #[tracing::instrument(skip_all)] async fn rfc7807_get( @@ -1495,7 +1474,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct UntypedPropertyGetBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::ObjectUntypedProps, } @@ -1510,7 +1489,6 @@ fn untyped_property_get_validation( Ok((body,)) } - /// UntypedPropertyGet - GET /untyped_property #[tracing::instrument(skip_all)] async fn untyped_property_get( @@ -1564,7 +1542,6 @@ where fn uuid_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// UuidGet - GET /uuid #[tracing::instrument(skip_all)] async fn uuid_get( @@ -1639,7 +1616,6 @@ struct XmlExtraPostBodyValidator<'a> { fn xml_extra_post_validation(body: Bytes) -> std::result::Result<(Bytes,), ValidationErrors> { Ok((body,)) } - /// XmlExtraPost - POST /xml_extra #[tracing::instrument(skip_all)] async fn xml_extra_post( @@ -1703,7 +1679,6 @@ struct XmlOtherPostBodyValidator<'a> { fn xml_other_post_validation(body: Bytes) -> std::result::Result<(Bytes,), ValidationErrors> { Ok((body,)) } - /// XmlOtherPost - POST /xml_other #[tracing::instrument(skip_all)] async fn xml_other_post( @@ -1779,7 +1754,6 @@ struct XmlOtherPutBodyValidator<'a> { fn xml_other_put_validation(body: Bytes) -> std::result::Result<(Bytes,), ValidationErrors> { Ok((body,)) } - /// XmlOtherPut - PUT /xml_other #[tracing::instrument(skip_all)] async fn xml_other_put( @@ -1843,7 +1817,6 @@ struct XmlPostBodyValidator<'a> { fn xml_post_validation(body: Bytes) -> std::result::Result<(Bytes,), ValidationErrors> { Ok((body,)) } - /// XmlPost - POST /xml #[tracing::instrument(skip_all)] async fn xml_post( @@ -1907,7 +1880,6 @@ struct XmlPutBodyValidator<'a> { fn xml_put_validation(body: Bytes) -> std::result::Result<(Bytes,), ValidationErrors> { Ok((body,)) } - /// XmlPut - PUT /xml #[tracing::instrument(skip_all)] async fn xml_put( @@ -1961,7 +1933,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct CreateRepoBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::ObjectParam, } @@ -1974,7 +1946,6 @@ fn create_repo_validation( Ok((body,)) } - /// CreateRepo - POST /repos #[tracing::instrument(skip_all)] async fn create_repo( @@ -2032,7 +2003,6 @@ fn get_repo_info_validation( Ok((path_params,)) } - /// GetRepoInfo - GET /repos/{repoId} #[tracing::instrument(skip_all)] async fn get_repo_info( diff --git a/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/VERSION index c9e125ba188..08bfd0643b8 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0-SNAPSHOT +7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/ops-v3/Cargo.toml b/samples/server/petstore/rust-axum/output/ops-v3/Cargo.toml index 80a1405875e..7969d169d30 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/ops-v3/Cargo.toml @@ -20,7 +20,7 @@ conversion = [ async-trait = "0.1" axum = { version = "0.7" } axum-extra = { version = "0.9", features = ["cookie", "multipart"] } -base64 = "0.21" +base64 = "0.22" bytes = "1" chrono = { version = "0.4", features = ["serde"] } frunk = { version = "0.4", optional = true } @@ -40,7 +40,7 @@ tokio = { version = "1", default-features = false, features = [ ] } tracing = { version = "0.1", features = ["attributes"] } uuid = { version = "1", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } +validator = { version = "0.18", features = ["derive"] } [dev-dependencies] tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/ops-v3/README.md b/samples/server/petstore/rust-axum/output/ops-v3/README.md index c32fe05320a..3cf44f6b023 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/README.md +++ b/samples/server/petstore/rust-axum/output/ops-v3/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 0.0.1 - +- Generator version: 7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs index 91aa8d085bb..19337219b02 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs @@ -3,11 +3,11 @@ trivial_casts, unused_variables, unused_mut, - unused_imports, unused_extern_crates, - non_camel_case_types + non_camel_case_types, + unused_imports, + unused_attributes )] -#![allow(unused_imports, unused_attributes)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs index ae991fadd5c..e9bc23c2cd3 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs @@ -75,7 +75,6 @@ where fn op10_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op10Get - GET /op10 #[tracing::instrument(skip_all)] async fn op10_get( @@ -128,7 +127,6 @@ where fn op11_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op11Get - GET /op11 #[tracing::instrument(skip_all)] async fn op11_get( @@ -181,7 +179,6 @@ where fn op12_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op12Get - GET /op12 #[tracing::instrument(skip_all)] async fn op12_get( @@ -234,7 +231,6 @@ where fn op13_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op13Get - GET /op13 #[tracing::instrument(skip_all)] async fn op13_get( @@ -287,7 +283,6 @@ where fn op14_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op14Get - GET /op14 #[tracing::instrument(skip_all)] async fn op14_get( @@ -340,7 +335,6 @@ where fn op15_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op15Get - GET /op15 #[tracing::instrument(skip_all)] async fn op15_get( @@ -393,7 +387,6 @@ where fn op16_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op16Get - GET /op16 #[tracing::instrument(skip_all)] async fn op16_get( @@ -446,7 +439,6 @@ where fn op17_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op17Get - GET /op17 #[tracing::instrument(skip_all)] async fn op17_get( @@ -499,7 +491,6 @@ where fn op18_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op18Get - GET /op18 #[tracing::instrument(skip_all)] async fn op18_get( @@ -552,7 +543,6 @@ where fn op19_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op19Get - GET /op19 #[tracing::instrument(skip_all)] async fn op19_get( @@ -605,7 +595,6 @@ where fn op1_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op1Get - GET /op1 #[tracing::instrument(skip_all)] async fn op1_get( @@ -658,7 +647,6 @@ where fn op20_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op20Get - GET /op20 #[tracing::instrument(skip_all)] async fn op20_get( @@ -711,7 +699,6 @@ where fn op21_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op21Get - GET /op21 #[tracing::instrument(skip_all)] async fn op21_get( @@ -764,7 +751,6 @@ where fn op22_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op22Get - GET /op22 #[tracing::instrument(skip_all)] async fn op22_get( @@ -817,7 +803,6 @@ where fn op23_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op23Get - GET /op23 #[tracing::instrument(skip_all)] async fn op23_get( @@ -870,7 +855,6 @@ where fn op24_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op24Get - GET /op24 #[tracing::instrument(skip_all)] async fn op24_get( @@ -923,7 +907,6 @@ where fn op25_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op25Get - GET /op25 #[tracing::instrument(skip_all)] async fn op25_get( @@ -976,7 +959,6 @@ where fn op26_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op26Get - GET /op26 #[tracing::instrument(skip_all)] async fn op26_get( @@ -1029,7 +1011,6 @@ where fn op27_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op27Get - GET /op27 #[tracing::instrument(skip_all)] async fn op27_get( @@ -1082,7 +1063,6 @@ where fn op28_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op28Get - GET /op28 #[tracing::instrument(skip_all)] async fn op28_get( @@ -1135,7 +1115,6 @@ where fn op29_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op29Get - GET /op29 #[tracing::instrument(skip_all)] async fn op29_get( @@ -1188,7 +1167,6 @@ where fn op2_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op2Get - GET /op2 #[tracing::instrument(skip_all)] async fn op2_get( @@ -1241,7 +1219,6 @@ where fn op30_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op30Get - GET /op30 #[tracing::instrument(skip_all)] async fn op30_get( @@ -1294,7 +1271,6 @@ where fn op31_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op31Get - GET /op31 #[tracing::instrument(skip_all)] async fn op31_get( @@ -1347,7 +1323,6 @@ where fn op32_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op32Get - GET /op32 #[tracing::instrument(skip_all)] async fn op32_get( @@ -1400,7 +1375,6 @@ where fn op33_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op33Get - GET /op33 #[tracing::instrument(skip_all)] async fn op33_get( @@ -1453,7 +1427,6 @@ where fn op34_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op34Get - GET /op34 #[tracing::instrument(skip_all)] async fn op34_get( @@ -1506,7 +1479,6 @@ where fn op35_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op35Get - GET /op35 #[tracing::instrument(skip_all)] async fn op35_get( @@ -1559,7 +1531,6 @@ where fn op36_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op36Get - GET /op36 #[tracing::instrument(skip_all)] async fn op36_get( @@ -1612,7 +1583,6 @@ where fn op37_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op37Get - GET /op37 #[tracing::instrument(skip_all)] async fn op37_get( @@ -1665,7 +1635,6 @@ where fn op3_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op3Get - GET /op3 #[tracing::instrument(skip_all)] async fn op3_get( @@ -1718,7 +1687,6 @@ where fn op4_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op4Get - GET /op4 #[tracing::instrument(skip_all)] async fn op4_get( @@ -1771,7 +1739,6 @@ where fn op5_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op5Get - GET /op5 #[tracing::instrument(skip_all)] async fn op5_get( @@ -1824,7 +1791,6 @@ where fn op6_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op6Get - GET /op6 #[tracing::instrument(skip_all)] async fn op6_get( @@ -1877,7 +1843,6 @@ where fn op7_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op7Get - GET /op7 #[tracing::instrument(skip_all)] async fn op7_get( @@ -1930,7 +1895,6 @@ where fn op8_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op8Get - GET /op8 #[tracing::instrument(skip_all)] async fn op8_get( @@ -1983,7 +1947,6 @@ where fn op9_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Op9Get - GET /op9 #[tracing::instrument(skip_all)] async fn op9_get( diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index c9e125ba188..08bfd0643b8 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0-SNAPSHOT +7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml index 42f579e8e99..7a7a1011388 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -22,7 +22,7 @@ conversion = [ async-trait = "0.1" axum = { version = "0.7" } axum-extra = { version = "0.9", features = ["cookie", "multipart"] } -base64 = "0.21" +base64 = "0.22" bytes = "1" chrono = { version = "0.4", features = ["serde"] } frunk = { version = "0.4", optional = true } @@ -42,7 +42,7 @@ tokio = { version = "1", default-features = false, features = [ ] } tracing = { version = "0.1", features = ["attributes"] } uuid = { version = "1", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } +validator = { version = "0.18", features = ["derive"] } [dev-dependencies] tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/README.md b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/README.md index 66718aba409..e48c2df3d01 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/README.md +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0.0 - +- Generator version: 7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index 553ab355813..5cc0e76a1a5 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -3,11 +3,11 @@ trivial_casts, unused_variables, unused_mut, - unused_imports, unused_extern_crates, - non_camel_case_types + non_camel_case_types, + unused_imports, + unused_attributes )] -#![allow(unused_imports, unused_attributes)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs index b1f8076c548..ccd8f72ef78 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs @@ -2768,12 +2768,14 @@ pub struct FormatTest { pub double: Option, #[serde(rename = "string")] - #[validate(regex = "RE_FORMATTEST_STRING")] + #[validate( + regex(path = *RE_FORMATTEST_STRING), + )] #[serde(skip_serializing_if = "Option::is_none")] pub string: Option, #[serde(rename = "byte")] - #[validate(custom = "validate_byte_formattest_byte")] + #[validate(custom(function = "validate_byte_formattest_byte"))] pub byte: ByteArray, #[serde(rename = "binary")] diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index 521d140f42b..cf0fe31c813 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -118,7 +118,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct TestSpecialTagsBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Client, } @@ -131,7 +131,6 @@ fn test_special_tags_validation( Ok((body,)) } - /// TestSpecialTags - PATCH /v2/another-fake/dummy #[tracing::instrument(skip_all)] async fn test_special_tags( @@ -207,7 +206,6 @@ where fn call123example_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// Call123example - GET /v2/fake/operation-with-numeric-id #[tracing::instrument(skip_all)] async fn call123example( @@ -262,7 +260,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct FakeOuterBooleanSerializeBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::OuterBoolean, } @@ -277,7 +275,6 @@ fn fake_outer_boolean_serialize_validation( Ok((body,)) } - /// FakeOuterBooleanSerialize - POST /v2/fake/outer/boolean #[tracing::instrument(skip_all)] async fn fake_outer_boolean_serialize( @@ -353,7 +350,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct FakeOuterCompositeSerializeBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::OuterComposite, } @@ -368,7 +365,6 @@ fn fake_outer_composite_serialize_validation( Ok((body,)) } - /// FakeOuterCompositeSerialize - POST /v2/fake/outer/composite #[tracing::instrument(skip_all)] async fn fake_outer_composite_serialize( @@ -444,7 +440,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct FakeOuterNumberSerializeBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::OuterNumber, } @@ -459,7 +455,6 @@ fn fake_outer_number_serialize_validation( Ok((body,)) } - /// FakeOuterNumberSerialize - POST /v2/fake/outer/number #[tracing::instrument(skip_all)] async fn fake_outer_number_serialize( @@ -535,7 +530,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct FakeOuterStringSerializeBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::OuterString, } @@ -550,7 +545,6 @@ fn fake_outer_string_serialize_validation( Ok((body,)) } - /// FakeOuterStringSerialize - POST /v2/fake/outer/string #[tracing::instrument(skip_all)] async fn fake_outer_string_serialize( @@ -628,7 +622,6 @@ fn fake_response_with_numerical_description_validation() -> std::result::Result< { Ok(()) } - /// FakeResponseWithNumericalDescription - GET /v2/fake/response-with-numerical-description #[tracing::instrument(skip_all)] async fn fake_response_with_numerical_description( @@ -689,7 +682,6 @@ fn hyphen_param_validation( Ok((path_params,)) } - /// HyphenParam - GET /v2/fake/hyphenParam/{hyphen-param} #[tracing::instrument(skip_all)] async fn hyphen_param( @@ -745,7 +737,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct TestBodyWithQueryParamsBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::User, } @@ -761,7 +753,6 @@ fn test_body_with_query_params_validation( Ok((query_params, body)) } - /// TestBodyWithQueryParams - PUT /v2/fake/body-with-query-params #[tracing::instrument(skip_all)] async fn test_body_with_query_params( @@ -820,7 +811,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct TestClientModelBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Client, } @@ -833,7 +824,6 @@ fn test_client_model_validation( Ok((body,)) } - /// TestClientModel - PATCH /v2/fake #[tracing::instrument(skip_all)] async fn test_client_model( @@ -909,7 +899,6 @@ where fn test_endpoint_parameters_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// TestEndpointParameters - POST /v2/fake #[tracing::instrument(skip_all)] async fn test_endpoint_parameters( @@ -981,7 +970,6 @@ fn test_enum_parameters_validation( Ok((header_params, query_params)) } - /// TestEnumParameters - GET /v2/fake #[tracing::instrument(skip_all)] async fn test_enum_parameters( @@ -1106,7 +1094,6 @@ fn test_inline_additional_properties_validation( Ok((body,)) } - /// TestInlineAdditionalProperties - POST /v2/fake/inline-additionalProperties #[tracing::instrument(skip_all)] async fn test_inline_additional_properties( @@ -1164,7 +1151,6 @@ where fn test_json_form_data_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// TestJsonFormData - GET /v2/fake/jsonFormData #[tracing::instrument(skip_all)] async fn test_json_form_data( @@ -1219,7 +1205,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct TestClassnameBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Client, } @@ -1232,7 +1218,6 @@ fn test_classname_validation( Ok((body,)) } - /// TestClassname - PATCH /v2/fake_classname_test #[tracing::instrument(skip_all)] async fn test_classname( @@ -1307,7 +1292,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct AddPetBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Pet, } @@ -1318,7 +1303,6 @@ fn add_pet_validation(body: models::Pet) -> std::result::Result<(models::Pet,), Ok((body,)) } - /// AddPet - POST /v2/pet #[tracing::instrument(skip_all)] async fn add_pet( @@ -1381,7 +1365,6 @@ fn delete_pet_validation( Ok((header_params, path_params)) } - /// DeletePet - DELETE /v2/pet/{petId} #[tracing::instrument(skip_all)] async fn delete_pet( @@ -1469,7 +1452,6 @@ fn find_pets_by_status_validation( Ok((query_params,)) } - /// FindPetsByStatus - GET /v2/pet/findByStatus #[tracing::instrument(skip_all)] async fn find_pets_by_status( @@ -1547,7 +1529,6 @@ fn find_pets_by_tags_validation( Ok((query_params,)) } - /// FindPetsByTags - GET /v2/pet/findByTags #[tracing::instrument(skip_all)] async fn find_pets_by_tags( @@ -1625,7 +1606,6 @@ fn get_pet_by_id_validation( Ok((path_params,)) } - /// GetPetById - GET /v2/pet/{petId} #[tracing::instrument(skip_all)] async fn get_pet_by_id( @@ -1701,7 +1681,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct UpdatePetBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Pet, } @@ -1714,7 +1694,6 @@ fn update_pet_validation( Ok((body,)) } - /// UpdatePet - PUT /v2/pet #[tracing::instrument(skip_all)] async fn update_pet( @@ -1783,7 +1762,6 @@ fn update_pet_with_form_validation( Ok((path_params,)) } - /// UpdatePetWithForm - POST /v2/pet/{petId} #[tracing::instrument(skip_all)] async fn update_pet_with_form( @@ -1845,7 +1823,6 @@ fn upload_file_validation( Ok((path_params,)) } - /// UploadFile - POST /v2/pet/{petId}/uploadImage #[tracing::instrument(skip_all)] async fn upload_file( @@ -1926,7 +1903,6 @@ fn delete_order_validation( Ok((path_params,)) } - /// DeleteOrder - DELETE /v2/store/order/{order_id} #[tracing::instrument(skip_all)] async fn delete_order( @@ -1987,7 +1963,6 @@ where fn get_inventory_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// GetInventory - GET /v2/store/inventory #[tracing::instrument(skip_all)] async fn get_inventory( @@ -2063,7 +2038,6 @@ fn get_order_by_id_validation( Ok((path_params,)) } - /// GetOrderById - GET /v2/store/order/{order_id} #[tracing::instrument(skip_all)] async fn get_order_by_id( @@ -2139,7 +2113,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct PlaceOrderBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Order, } @@ -2152,7 +2126,6 @@ fn place_order_validation( Ok((body,)) } - /// PlaceOrder - POST /v2/store/order #[tracing::instrument(skip_all)] async fn place_order( @@ -2224,7 +2197,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct CreateUserBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::User, } @@ -2237,7 +2210,6 @@ fn create_user_validation( Ok((body,)) } - /// CreateUser - POST /v2/user #[tracing::instrument(skip_all)] async fn create_user( @@ -2293,7 +2265,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct CreateUsersWithArrayInputBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a Vec, } @@ -2306,7 +2278,6 @@ fn create_users_with_array_input_validation( Ok((body,)) } - /// CreateUsersWithArrayInput - POST /v2/user/createWithArray #[tracing::instrument(skip_all)] async fn create_users_with_array_input( @@ -2363,7 +2334,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct CreateUsersWithListInputBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a Vec, } @@ -2376,7 +2347,6 @@ fn create_users_with_list_input_validation( Ok((body,)) } - /// CreateUsersWithListInput - POST /v2/user/createWithList #[tracing::instrument(skip_all)] async fn create_users_with_list_input( @@ -2438,7 +2408,6 @@ fn delete_user_validation( Ok((path_params,)) } - /// DeleteUser - DELETE /v2/user/{username} #[tracing::instrument(skip_all)] async fn delete_user( @@ -2503,7 +2472,6 @@ fn get_user_by_name_validation( Ok((path_params,)) } - /// GetUserByName - GET /v2/user/{username} #[tracing::instrument(skip_all)] async fn get_user_by_name( @@ -2584,7 +2552,6 @@ fn login_user_validation( Ok((query_params,)) } - /// LoginUser - GET /v2/user/login #[tracing::instrument(skip_all)] async fn login_user( @@ -2636,8 +2603,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers - .insert(HeaderName::from_static("x-rate-limit"), x_rate_limit); + response_headers.insert(HeaderName::from_static(""), x_rate_limit); } } if let Some(x_expires_after) = x_expires_after { @@ -2653,8 +2619,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers - .insert(HeaderName::from_static("x-expires-after"), x_expires_after); + response_headers.insert(HeaderName::from_static(""), x_expires_after); } } @@ -2695,7 +2660,6 @@ where fn logout_user_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// LogoutUser - GET /v2/user/logout #[tracing::instrument(skip_all)] async fn logout_user( @@ -2747,7 +2711,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct UpdateUserBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::User, } @@ -2762,7 +2726,6 @@ fn update_user_validation( Ok((path_params, body)) } - /// UpdateUser - PUT /v2/user/{username} #[tracing::instrument(skip_all)] async fn update_user( diff --git a/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/VERSION index c9e125ba188..08bfd0643b8 100644 --- a/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0-SNAPSHOT +7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/petstore/Cargo.toml b/samples/server/petstore/rust-axum/output/petstore/Cargo.toml index bdc5cf7766c..2dc9654f615 100644 --- a/samples/server/petstore/rust-axum/output/petstore/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/petstore/Cargo.toml @@ -21,7 +21,7 @@ conversion = [ async-trait = "0.1" axum = { version = "0.7" } axum-extra = { version = "0.9", features = ["cookie", "multipart"] } -base64 = "0.21" +base64 = "0.22" bytes = "1" chrono = { version = "0.4", features = ["serde"] } frunk = { version = "0.4", optional = true } @@ -41,7 +41,7 @@ tokio = { version = "1", default-features = false, features = [ ] } tracing = { version = "0.1", features = ["attributes"] } uuid = { version = "1", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } +validator = { version = "0.18", features = ["derive"] } [dev-dependencies] tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/petstore/README.md b/samples/server/petstore/rust-axum/output/petstore/README.md index 3a9a839d794..795a6f427e3 100644 --- a/samples/server/petstore/rust-axum/output/petstore/README.md +++ b/samples/server/petstore/rust-axum/output/petstore/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0.0 - +- Generator version: 7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/petstore/src/lib.rs b/samples/server/petstore/rust-axum/output/petstore/src/lib.rs index eef1a4fbdc1..50d589234ee 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/lib.rs @@ -3,11 +3,11 @@ trivial_casts, unused_variables, unused_mut, - unused_imports, unused_extern_crates, - non_camel_case_types + non_camel_case_types, + unused_imports, + unused_attributes )] -#![allow(unused_imports, unused_attributes)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/samples/server/petstore/rust-axum/output/petstore/src/models.rs b/samples/server/petstore/rust-axum/output/petstore/src/models.rs index cb639d3f374..3bc961a8430 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/models.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/models.rs @@ -92,7 +92,9 @@ pub struct GetUserByNamePathParams { pub struct LoginUserQueryParams { /// The user name for login #[serde(rename = "username")] - #[validate(regex = "RE_LOGINUSERQUERYPARAMS_USERNAME")] + #[validate( + regex(path = *RE_LOGINUSERQUERYPARAMS_USERNAME), + )] pub username: String, /// The password for login in clear text #[serde(rename = "password")] @@ -287,7 +289,9 @@ pub struct Category { pub id: Option, #[serde(rename = "name")] - #[validate(regex = "RE_CATEGORY_NAME")] + #[validate( + regex(path = *RE_CATEGORY_NAME), + )] #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, } diff --git a/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs b/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs index 87e0b820afb..51fb05bcfa2 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs @@ -68,7 +68,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct AddPetBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Pet, } @@ -79,7 +79,6 @@ fn add_pet_validation(body: models::Pet) -> std::result::Result<(models::Pet,), Ok((body,)) } - /// AddPet - POST /v2/pet #[tracing::instrument(skip_all)] async fn add_pet( @@ -158,7 +157,6 @@ fn delete_pet_validation( Ok((header_params, path_params)) } - /// DeletePet - DELETE /v2/pet/{petId} #[tracing::instrument(skip_all)] async fn delete_pet( @@ -246,7 +244,6 @@ fn find_pets_by_status_validation( Ok((query_params,)) } - /// FindPetsByStatus - GET /v2/pet/findByStatus #[tracing::instrument(skip_all)] async fn find_pets_by_status( @@ -324,7 +321,6 @@ fn find_pets_by_tags_validation( Ok((query_params,)) } - /// FindPetsByTags - GET /v2/pet/findByTags #[tracing::instrument(skip_all)] async fn find_pets_by_tags( @@ -402,7 +398,6 @@ fn get_pet_by_id_validation( Ok((path_params,)) } - /// GetPetById - GET /v2/pet/{petId} #[tracing::instrument(skip_all)] async fn get_pet_by_id( @@ -478,7 +473,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct UpdatePetBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Pet, } @@ -491,7 +486,6 @@ fn update_pet_validation( Ok((body,)) } - /// UpdatePet - PUT /v2/pet #[tracing::instrument(skip_all)] async fn update_pet( @@ -576,7 +570,6 @@ fn update_pet_with_form_validation( Ok((path_params,)) } - /// UpdatePetWithForm - POST /v2/pet/{petId} #[tracing::instrument(skip_all)] async fn update_pet_with_form( @@ -638,7 +631,6 @@ fn upload_file_validation( Ok((path_params,)) } - /// UploadFile - POST /v2/pet/{petId}/uploadImage #[tracing::instrument(skip_all)] async fn upload_file( @@ -719,7 +711,6 @@ fn delete_order_validation( Ok((path_params,)) } - /// DeleteOrder - DELETE /v2/store/order/{orderId} #[tracing::instrument(skip_all)] async fn delete_order( @@ -780,7 +771,6 @@ where fn get_inventory_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// GetInventory - GET /v2/store/inventory #[tracing::instrument(skip_all)] async fn get_inventory( @@ -856,7 +846,6 @@ fn get_order_by_id_validation( Ok((path_params,)) } - /// GetOrderById - GET /v2/store/order/{orderId} #[tracing::instrument(skip_all)] async fn get_order_by_id( @@ -932,7 +921,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct PlaceOrderBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::Order, } @@ -945,7 +934,6 @@ fn place_order_validation( Ok((body,)) } - /// PlaceOrder - POST /v2/store/order #[tracing::instrument(skip_all)] async fn place_order( @@ -1017,7 +1005,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct CreateUserBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::User, } @@ -1030,7 +1018,6 @@ fn create_user_validation( Ok((body,)) } - /// CreateUser - POST /v2/user #[tracing::instrument(skip_all)] async fn create_user( @@ -1086,7 +1073,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct CreateUsersWithArrayInputBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a Vec, } @@ -1099,7 +1086,6 @@ fn create_users_with_array_input_validation( Ok((body,)) } - /// CreateUsersWithArrayInput - POST /v2/user/createWithArray #[tracing::instrument(skip_all)] async fn create_users_with_array_input( @@ -1156,7 +1142,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct CreateUsersWithListInputBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a Vec, } @@ -1169,7 +1155,6 @@ fn create_users_with_list_input_validation( Ok((body,)) } - /// CreateUsersWithListInput - POST /v2/user/createWithList #[tracing::instrument(skip_all)] async fn create_users_with_list_input( @@ -1231,7 +1216,6 @@ fn delete_user_validation( Ok((path_params,)) } - /// DeleteUser - DELETE /v2/user/{username} #[tracing::instrument(skip_all)] async fn delete_user( @@ -1296,7 +1280,6 @@ fn get_user_by_name_validation( Ok((path_params,)) } - /// GetUserByName - GET /v2/user/{username} #[tracing::instrument(skip_all)] async fn get_user_by_name( @@ -1377,7 +1360,6 @@ fn login_user_validation( Ok((query_params,)) } - /// LoginUser - GET /v2/user/login #[tracing::instrument(skip_all)] async fn login_user( @@ -1430,7 +1412,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers.insert(HeaderName::from_static("set-cookie"), set_cookie); + response_headers.insert(HeaderName::from_static(""), set_cookie); } } if let Some(x_rate_limit) = x_rate_limit { @@ -1445,8 +1427,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers - .insert(HeaderName::from_static("x-rate-limit"), x_rate_limit); + response_headers.insert(HeaderName::from_static(""), x_rate_limit); } } if let Some(x_expires_after) = x_expires_after { @@ -1462,8 +1443,7 @@ where { let mut response_headers = response.headers_mut().unwrap(); - response_headers - .insert(HeaderName::from_static("x-expires-after"), x_expires_after); + response_headers.insert(HeaderName::from_static(""), x_expires_after); } } @@ -1504,7 +1484,6 @@ where fn logout_user_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// LogoutUser - GET /v2/user/logout #[tracing::instrument(skip_all)] async fn logout_user( @@ -1556,7 +1535,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct UpdateUserBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::User, } @@ -1571,7 +1550,6 @@ fn update_user_validation( Ok((path_params, body)) } - /// UpdateUser - PUT /v2/user/{username} #[tracing::instrument(skip_all)] async fn update_user( diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/VERSION index c9e125ba188..08bfd0643b8 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0-SNAPSHOT +7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/Cargo.toml b/samples/server/petstore/rust-axum/output/ping-bearer-auth/Cargo.toml index fa0a6c1f3ed..df7f8cd5207 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/Cargo.toml @@ -20,7 +20,7 @@ conversion = [ async-trait = "0.1" axum = { version = "0.7" } axum-extra = { version = "0.9", features = ["cookie", "multipart"] } -base64 = "0.21" +base64 = "0.22" bytes = "1" chrono = { version = "0.4", features = ["serde"] } frunk = { version = "0.4", optional = true } @@ -40,7 +40,7 @@ tokio = { version = "1", default-features = false, features = [ ] } tracing = { version = "0.1", features = ["attributes"] } uuid = { version = "1", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } +validator = { version = "0.18", features = ["derive"] } [dev-dependencies] tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/README.md b/samples/server/petstore/rust-axum/output/ping-bearer-auth/README.md index 46a6534028d..56b88a40475 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/README.md +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0 - +- Generator version: 7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs index 5b44cc42895..f09f3f93369 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs @@ -3,11 +3,11 @@ trivial_casts, unused_variables, unused_mut, - unused_imports, unused_extern_crates, - non_camel_case_types + non_camel_case_types, + unused_imports, + unused_attributes )] -#![allow(unused_imports, unused_attributes)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs index 5ec08d2d341..6f0aa768504 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs @@ -30,7 +30,6 @@ where fn ping_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// PingGet - GET /ping #[tracing::instrument(skip_all)] async fn ping_get( diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/VERSION index c9e125ba188..08bfd0643b8 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0-SNAPSHOT +7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/Cargo.toml b/samples/server/petstore/rust-axum/output/rust-axum-test/Cargo.toml index 347c1aad2d7..2c9049bb789 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/Cargo.toml @@ -20,7 +20,7 @@ conversion = [ async-trait = "0.1" axum = { version = "0.7" } axum-extra = { version = "0.9", features = ["cookie", "multipart"] } -base64 = "0.21" +base64 = "0.22" bytes = "1" chrono = { version = "0.4", features = ["serde"] } frunk = { version = "0.4", optional = true } @@ -40,7 +40,7 @@ tokio = { version = "1", default-features = false, features = [ ] } tracing = { version = "0.1", features = ["attributes"] } uuid = { version = "1", features = ["serde"] } -validator = { version = "0.16", features = ["derive"] } +validator = { version = "0.18", features = ["derive"] } [dev-dependencies] tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/README.md b/samples/server/petstore/rust-axum/output/rust-axum-test/README.md index b71f8cde216..d1f027f128d 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/README.md +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 2.3.4 - +- Generator version: 7.5.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs index 4024a01566d..305ff1df6d1 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs @@ -3,11 +3,11 @@ trivial_casts, unused_variables, unused_mut, - unused_imports, unused_extern_crates, - non_camel_case_types + non_camel_case_types, + unused_imports, + unused_attributes )] -#![allow(unused_imports, unused_attributes)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs index 7acb80ed7ad..da5d544f848 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs @@ -41,7 +41,6 @@ where fn all_of_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// AllOfGet - GET /allOf #[tracing::instrument(skip_all)] async fn all_of_get( @@ -113,7 +112,6 @@ where fn dummy_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// DummyGet - GET /dummy #[tracing::instrument(skip_all)] async fn dummy_get( @@ -165,7 +163,7 @@ where #[derive(validator::Validate)] #[allow(dead_code)] struct DummyPutBodyValidator<'a> { - #[validate] + #[validate(nested)] body: &'a models::DummyPutRequest, } @@ -178,7 +176,6 @@ fn dummy_put_validation( Ok((body,)) } - /// DummyPut - PUT /dummy #[tracing::instrument(skip_all)] async fn dummy_put( @@ -235,7 +232,6 @@ where fn file_response_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// FileResponseGet - GET /file_response #[tracing::instrument(skip_all)] async fn file_response_get( @@ -310,7 +306,6 @@ where fn get_structured_yaml_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// GetStructuredYaml - GET /get-structured-yaml #[tracing::instrument(skip_all)] async fn get_structured_yaml( @@ -384,7 +379,6 @@ struct HtmlPostBodyValidator<'a> { fn html_post_validation(body: String) -> std::result::Result<(String,), ValidationErrors> { Ok((body,)) } - /// HtmlPost - POST /html #[tracing::instrument(skip_all)] async fn html_post( @@ -459,7 +453,6 @@ struct PostYamlBodyValidator<'a> { fn post_yaml_validation(body: String) -> std::result::Result<(String,), ValidationErrors> { Ok((body,)) } - /// PostYaml - POST /post-yaml #[tracing::instrument(skip_all)] async fn post_yaml( @@ -516,7 +509,6 @@ where fn raw_json_get_validation() -> std::result::Result<(), ValidationErrors> { Ok(()) } - /// RawJsonGet - GET /raw_json #[tracing::instrument(skip_all)] async fn raw_json_get( @@ -599,7 +591,6 @@ fn solo_object_post_validation( Ok((body,)) } - /// SoloObjectPost - POST /solo-object #[tracing::instrument(skip_all)] async fn solo_object_post(