diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 16e2da7a78c..406caa69c1d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -544,7 +544,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { } private boolean isMimetypePlain(String mimetype) { - return isMimetypePlainText(mimetype) || isMimetypeHtmlText(mimetype) || isMimetypeOctetStream(mimetype); + return isMimetypePlainText(mimetype) || isMimetypeHtmlText(mimetype) || isMimetypeOctetStream(mimetype); } @Override @@ -560,7 +560,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { pathFormatString = pathFormatString.replace(paramSearch, paramReplace); } - op.vendorExtensions.put("pathFormatString", pathFormatString); + op.vendorExtensions.put("x-path-format-string", pathFormatString); // The Rust code will need to contain a series of regular expressions. // For performance, we'll construct these at start-of-day and re-use @@ -1019,7 +1019,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { am.getItems() != null && !StringUtils.isEmpty(am.getItems().get$ref())) { Schema inner_schema = allDefinitions.get( - ModelUtils.getSimpleRef(am.getItems().get$ref())); + ModelUtils.getSimpleRef(am.getItems().get$ref())); if (inner_schema.getXml() != null && inner_schema.getXml().getName() != null) { @@ -1271,9 +1271,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { // the user than the alternative. LOGGER.warn("Ignoring additionalProperties (see https://github.com/OpenAPITools/openapi-generator/issues/318) alongside defined properties"); cm.dataType = null; - } - else - { + } else { String type; if (typeMapping.containsKey(cm.additionalPropertiesType)) { diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache index 4bc03901ad4..575e7fee69a 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache @@ -262,7 +262,7 @@ impl Api for Client where {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, param_{{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box> { let mut uri = format!( - "{}{{{basePathWithoutHost}}}{{#vendorExtensions}}{{pathFormatString}}{{/vendorExtensions}}", + "{}{{{basePathWithoutHost}}}{{{vendorExtensions.x-path-format-string}}}", self.base_path{{#pathParams}}, {{{paramName}}}=utf8_percent_encode(¶m_{{{paramName}}}.to_string(), ID_ENCODE_SET){{/pathParams}} ); diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml index 8e1b2de1432..e94a4c5fe98 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml @@ -996,7 +996,7 @@ paths: schema: type: string responses: - 200: + "200": content: {} description: Success tags: