diff --git a/README.md b/README.md index 393de55f2021..b31c58d649a9 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0, 3.1 (beta support) For old releases, please refer to the [**Release**](https://github.com/OpenAPITools/openapi-generator/releases) page. -For decomissioned generators/libraries/frameworks, please refer to [the "Decommission" label](https://github.com/OpenAPITools/openapi-generator/issues?q=label%3ADecommission+is%3Amerged+) in the pull request page. +For decommissioned generators/libraries/frameworks, please refer to [the "Decommission" label](https://github.com/OpenAPITools/openapi-generator/issues?q=label%3ADecommission+is%3Amerged+) in the pull request page. ## [1.2 - Artifacts on Maven Central](#table-of-contents) diff --git a/docs/3.0.0-release-note.md b/docs/3.0.0-release-note.md index b2127975817e..e61130b9fde7 100644 --- a/docs/3.0.0-release-note.md +++ b/docs/3.0.0-release-note.md @@ -10,7 +10,7 @@ sidebar_label: "Release Notes: 3.0.0" * e58dc2c77 Fix COPY in Dockerfile (#64) * 9d7feaaeb Fix online generator (docker push) (#58) * 9247cd01e Changes for Docker -* 64037ee59 update docker-related files to ues jdk8 +* 64037ee59 update docker-related files to use jdk8 * ## Plug-ins * b6b8c0db8 \[gradle-plugin] Initial implementation (#162) diff --git a/docs/customization.md b/docs/customization.md index f0026728d1c1..89b6a4e4bd51 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -266,7 +266,7 @@ Upon first code generation, you may also pass the CLI option `--ignore-file-over Editor support for `.openapi-generator-ignore` files is available in IntelliJ via the [.ignore plugin](https://plugins.jetbrains.com/plugin/7495--ignore). -One may want to pre-populate `.openapi-generator-ignore` with a list of entries during the code generation process and the global/general option `openapiGeneatorIgnoreList` (e.g. --openapi-generator-ignore-list in CLI) can do exactly that. For example, +One may want to pre-populate `.openapi-generator-ignore` with a list of entries during the code generation process and the global/general option `openapiGeneratorIgnoreList` (e.g. --openapi-generator-ignore-list in CLI) can do exactly that. For example, ``` java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g spring -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/spring --additional-properties useTags=true --openapi-generator-ignore-list "README.md,pom.xml,docs/*.md,src/main/java/org/openapitools/model/*" ``` @@ -434,9 +434,9 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat ``` will rename SOLD to UNAVAILABLE instead. -Not all generators support thess features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings), #17108 (enumNameMappings). +Not all generators support these features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings), #17108 (enumNameMappings). -NOTE: some generators use `baseName` (original name obtained direclty from OpenAPI spec, e.g. `shipping-date`) mustache tag in the templates so the mapping feature won't work. +NOTE: some generators use `baseName` (original name obtained directly from OpenAPI spec, e.g. `shipping-date`) mustache tag in the templates so the mapping feature won't work. To map `operationId` (used in method naming) to something else, use `operationIdNameMappings` option, e.g. @@ -480,7 +480,7 @@ paths: ## Inline Schema Naming -Inline schemas are created as separate schemas automatically and the auto-generated schema name may not look good to everyone. One can customize the name using the `title` field or the `inlineSchemaNameMapping` option. For exmaple, run the following, +Inline schemas are created as separate schemas automatically and the auto-generated schema name may not look good to everyone. One can customize the name using the `title` field or the `inlineSchemaNameMapping` option. For example, run the following, ``` java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml -o /tmp/java3/ --skip-validate-spec --inline-schema-name-mappings inline_object_2=SomethingMapped,inline_object_4=nothing_new @@ -503,7 +503,7 @@ Another useful option is `inlineSchemaOptions`, which allows you to customize ho - `ARRAY_ITEM_SUFFIX` sets the array item suffix - `MAP_ITEM_SUFFIX` set the map item suffix - `SKIP_SCHEMA_REUSE=true` is a special value to skip reusing inline schemas during refactoring -- `REFACTOR_ALLOF_INLINE_SCHEMAS=true` will restore the 6.x (or below) behaviour to refactor allOf inline schemas into $ref. (v7.0.0 will skip the refactoring of these allOf inline schmeas by default) +- `REFACTOR_ALLOF_INLINE_SCHEMAS=true` will restore the 6.x (or below) behaviour to refactor allOf inline schemas into $ref. (v7.0.0 will skip the refactoring of these allOf inline schemas by default) - `RESOLVE_INLINE_ENUMS=true` will refactor inline enum definitions into $ref ## OpenAPI Normalizer @@ -524,7 +524,7 @@ Example: java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml -o /tmp/java-okhttp/ --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true ``` -- `REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY`: when set to `true`, oneOf/anyOf schema with only required properies only in a schema with properties will be removed. [(example)](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/removeAnyOfOneOfAndKeepPropertiesOnly_test.yaml) +- `REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY`: when set to `true`, oneOf/anyOf schema with only required properties only in a schema with properties will be removed. [(example)](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/removeAnyOfOneOfAndKeepPropertiesOnly_test.yaml) Example: ``` diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 7fa87c399681..792ca0dda2c0 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -865,7 +865,7 @@ public void execute() throws MojoExecutionException { } // Apply Parameter Name Mappings - if (parameterNameMappings != null && (configOptions == null || !configOptions.containsKey("paramter-name-mappings"))) { + if (parameterNameMappings != null && (configOptions == null || !configOptions.containsKey("parameter-name-mappings"))) { applyParameterNameMappingsKvpList(parameterNameMappings, configurator); } 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 d8b577c93cae..a015dee2a21b 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 @@ -1942,9 +1942,9 @@ public String toInstantiationType(Schema schema) { if (ModelUtils.isMapSchema(schema)) { Schema additionalProperties = ModelUtils.getAdditionalProperties(schema); String inner = getSchemaType(additionalProperties); - String mapInstantion = instantiationTypes.get("map"); - if (mapInstantion != null) { - return mapInstantion + ""; + String mapInstantiation = instantiationTypes.get("map"); + if (mapInstantiation != null) { + return mapInstantiation + ""; } return inner; } else if (ModelUtils.isArraySchema(schema)) { @@ -2217,7 +2217,7 @@ public String toDefaultValueWithParam(String name, Schema schema) { * @return string presentation of the default value of the property */ public String toDefaultValue(CodegenProperty codegenProperty, Schema schema) { - // use toDefaultValue(schema) if generator has not overriden this method + // use toDefaultValue(schema) if generator has not overridden this method return toDefaultValue(schema); } @@ -3149,7 +3149,7 @@ protected void setAddProps(Schema schema, IJsonSchemaValidationProperties proper // if we are trying to set additionalProperties on an empty schema stop recursing return; } - // Note: This flag is set to true if additioanl properties + // Note: This flag is set to true if additional properties // is set (any type, free form object, boolean true, string, etc). // The variable name may be renamed later to avoid confusion. boolean additionalPropertiesIsAnyType = false; @@ -3989,7 +3989,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo property._enum = new ArrayList<>(); for (Object i : _enum) { // raw null values in enums are unions for nullable - // atttributes, not actual enum values, so we remove them here + // attributes, not actual enum values, so we remove them here if (i == null) { property.isNullable = true; continue; @@ -4001,7 +4001,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo Map allowableValues = new HashMap<>(); allowableValues.put("values", _enum); - if (allowableValues.size() > 0) { + if (!allowableValues.isEmpty()) { property.allowableValues = allowableValues; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java index 44fa54695702..25265ef0f548 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java @@ -836,7 +836,7 @@ private Schema normalizeComplexComposedSchema(Schema schema, Set visited } // ===================== a list of rules ===================== - // all rules (fuctions) start with the word "process" + // all rules (functions ) start with the word "process" /** * Child schemas in `allOf` is considered a parent if it's a `$ref` (instead of inline schema). diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 399134bfcd6a..960a5c8d71a2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -936,7 +936,7 @@ private boolean startsWithTwoUppercaseLetters(String name) { @Override public String toParamName(String name) { - // obtain the name from paramterNameMapping directly if provided + // obtain the name from parameterNameMapping directly if provided if (parameterNameMapping.containsKey(name)) { return parameterNameMapping.get(name); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java index 81cee1d2786c..b8a628ed5271 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java @@ -173,7 +173,7 @@ protected static String dropDots(String str) { /** * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping - * those terms here. This logic is only called if a variable matches the reseved words + * those terms here. This logic is only called if a variable matches the reserved words * * @return the escaped term */ diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index 6c49ce78fd74..f6813081563c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -1185,7 +1185,7 @@ private String getModelNameFromDataType(CodegenProperty cp) { } /** - * Update set of imports from codegen model recursivly + * Update set of imports from codegen model recursively * * @param modelName model name * @param cm codegen model @@ -1362,7 +1362,7 @@ public void postProcessPattern(String pattern, Map vendorExtensi if (pattern != null) { int i = pattern.lastIndexOf('/'); - // TOOD update the check below follow python convention + // TODO update the check below follow python convention //Must follow Perl /pattern/modifiers convention if (pattern.charAt(0) != '/' || i < 2) { throw new IllegalArgumentException("Pattern must follow the Perl " diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java index 58808b6b01a1..c697bc8f2346 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java @@ -1687,7 +1687,7 @@ private String getModelNameFromDataType(CodegenProperty cp) { } /** - * Update set of imports from codegen model recursivly + * Update set of imports from codegen model recursively * * @param modelName model name * @param cm codegen model @@ -1896,7 +1896,7 @@ public void postProcessPattern(String pattern, Map vendorExtensi if (pattern != null) { int i = pattern.lastIndexOf('/'); - // TOOD update the check below follow python convention + // TODO update the check below follow python convention //Must follow Perl /pattern/modifiers convention if (pattern.charAt(0) != '/' || i < 2) { throw new IllegalArgumentException("Pattern must follow the Perl " diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 25588dfa7eac..bf1ca99b64f1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -335,7 +335,7 @@ public String apiFileFolder() { } /** - * Location of created model files (it can be overriden using --additional-properties in openapi-generator-cli + * Location of created model files (it can be overridden using --additional-properties in openapi-generator-cli */ @Override public String modelFileFolder() { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index d56f102f7e0c..726a05d1a615 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -320,7 +320,7 @@ public void processOpts() { dateLibrary = "legacy"; } super.processOpts(); - // default jackson unless overriden by setSerializationLibrary + // default jackson unless overridden by setSerializationLibrary this.jackson = !additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY) || SERIALIZATION_LIBRARY_JACKSON.equals(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY)); convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index c9b6d6dc23d0..7d31d780511f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -793,7 +793,7 @@ private void processJVMOkHttpLibrary(final String infrastructureFolder) { supportingFiles.add(new SupportingFile("infrastructure/ApiResponse.kt.mustache", infrastructureFolder, "ApiResponse.kt")); } - private void proccessJvmSpring(final String infrastructureFolder) { + private void processJvmSpring(final String infrastructureFolder) { if (getSerializationLibrary() != SERIALIZATION_LIBRARY_TYPE.jackson) { throw new RuntimeException("This library currently only supports jackson serialization. Try adding '--additional-properties serializationLibrary=jackson' to your command."); } @@ -806,7 +806,7 @@ private void proccessJvmSpring(final String infrastructureFolder) { } private void processJvmSpringWebClientLibrary(final String infrastructureFolder) { - proccessJvmSpring(infrastructureFolder); + processJvmSpring(infrastructureFolder); additionalProperties.put(JVM_SPRING_WEBCLIENT, true); } @@ -815,7 +815,7 @@ private void processJvmSpringRestClientLibrary(final String infrastructureFolder throw new RuntimeException("This library must use Spring Boot 3. Try adding '--additional-properties useSpringBoot3=true' to your command."); } - proccessJvmSpring(infrastructureFolder); + processJvmSpring(infrastructureFolder); additionalProperties.put(JVM_SPRING_RESTCLIENT, true); } 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 c0d3accc11a1..76c4c51ca7c1 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 @@ -1226,7 +1226,7 @@ public CodegenModel fromModel(String name, Schema model) { } } - // Do we suppport doing ToString/FromStr conversions for query parameters? + // Do we support doing ToString/FromStr conversions for query parameters? boolean toStringSupport = true; boolean isString = "String".equals(mdl.dataType); diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json b/modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json index 1fee47e06241..ed62ce62b1e6 100644 --- a/modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json @@ -94117,7 +94117,7 @@ "nullable": true }, "idle_timeout_notice": { - "description": "Text to show user when codespace idle timeout minutes has been overriden by an organization policy", + "description": "Text to show user when codespace idle timeout minutes has been overridden by an organization policy", "type": "string", "nullable": true }, @@ -116606,7 +116606,7 @@ "nullable": true }, "idle_timeout_notice": { - "description": "Text to show user when codespace idle timeout minutes has been overriden by an organization policy", + "description": "Text to show user when codespace idle timeout minutes has been overridden by an organization policy", "type": "string", "nullable": true },