From ee7c8a82e895b7613cd5960f4768336ed293f858 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sun, 25 Aug 2019 19:19:52 -0400 Subject: [PATCH] [BUG][CLI][GENERATOR] NullPointer when not setting outputDir (updated) (#3752) * Fixes NPE when no outputDir is set * Fix behaviors of default values for values not provided by user * Easier handling of default behavior in settings. * Fixes for dynamic config deserialization (specifically, ruby client sample fix) * Tests for WorkflowSettings (defaults, modified defaults, nulls) * Test modification of WorkflowSettings defaults for both class constructor and builder --- bin/ruby-petstore-faraday.json | 3 +- bin/ruby-petstore.json | 3 +- .../codegen/config/GeneratorSettings.java | 28 +++- .../codegen/config/WorkflowSettings.java | 147 ++++++++++-------- .../codegen/config/WorkflowSettingsTest.java | 103 ++++++++++++ .../codegen/config/CodegenConfigurator.java | 1 + .../ruby-faraday/.openapi-generator/VERSION | 2 +- .../client/petstore/ruby-faraday/README.md | 1 + .../petstore/ruby-faraday/docs/FakeApi.md | 54 +++++++ .../petstore/ruby-faraday/lib/petstore.rb | 2 +- .../lib/petstore/api/another_fake_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 89 ++++++++++- .../api/fake_classname_tags123_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/pet_api.rb | 2 +- .../lib/petstore/api/store_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/user_api.rb | 2 +- .../ruby-faraday/lib/petstore/api_client.rb | 129 +++++++-------- .../ruby-faraday/lib/petstore/api_error.rb | 2 +- .../lib/petstore/configuration.rb | 29 ++-- .../models/additional_properties_any_type.rb | 2 +- .../models/additional_properties_array.rb | 2 +- .../models/additional_properties_boolean.rb | 2 +- .../models/additional_properties_class.rb | 2 +- .../models/additional_properties_integer.rb | 2 +- .../models/additional_properties_number.rb | 2 +- .../models/additional_properties_object.rb | 2 +- .../models/additional_properties_string.rb | 2 +- .../lib/petstore/models/animal.rb | 2 +- .../lib/petstore/models/api_response.rb | 2 +- .../models/array_of_array_of_number_only.rb | 2 +- .../petstore/models/array_of_number_only.rb | 2 +- .../lib/petstore/models/array_test.rb | 2 +- .../lib/petstore/models/capitalization.rb | 2 +- .../ruby-faraday/lib/petstore/models/cat.rb | 2 +- .../lib/petstore/models/cat_all_of.rb | 2 +- .../lib/petstore/models/category.rb | 2 +- .../lib/petstore/models/class_model.rb | 2 +- .../lib/petstore/models/client.rb | 2 +- .../ruby-faraday/lib/petstore/models/dog.rb | 2 +- .../lib/petstore/models/dog_all_of.rb | 2 +- .../lib/petstore/models/enum_arrays.rb | 2 +- .../lib/petstore/models/enum_class.rb | 2 +- .../lib/petstore/models/enum_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/file.rb | 2 +- .../petstore/models/file_schema_test_class.rb | 2 +- .../lib/petstore/models/format_test.rb | 2 +- .../lib/petstore/models/has_only_read_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/list.rb | 2 +- .../lib/petstore/models/map_test.rb | 2 +- ...perties_and_additional_properties_class.rb | 2 +- .../lib/petstore/models/model200_response.rb | 2 +- .../lib/petstore/models/model_return.rb | 2 +- .../ruby-faraday/lib/petstore/models/name.rb | 2 +- .../lib/petstore/models/number_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/order.rb | 2 +- .../lib/petstore/models/outer_composite.rb | 2 +- .../lib/petstore/models/outer_enum.rb | 2 +- .../ruby-faraday/lib/petstore/models/pet.rb | 2 +- .../lib/petstore/models/read_only_first.rb | 2 +- .../lib/petstore/models/special_model_name.rb | 2 +- .../ruby-faraday/lib/petstore/models/tag.rb | 2 +- .../petstore/models/type_holder_default.rb | 2 +- .../petstore/models/type_holder_example.rb | 2 +- .../ruby-faraday/lib/petstore/models/user.rb | 2 +- .../lib/petstore/models/xml_item.rb | 2 +- .../ruby-faraday/lib/petstore/version.rb | 2 +- .../petstore/ruby-faraday/petstore.gemspec | 4 +- .../petstore/rust/.openapi-generator/VERSION | 2 +- .../client/petstore/rust/docs/InlineObject.md | 12 ++ .../petstore/rust/docs/InlineObject1.md | 12 ++ .../petstore/rust/src/models/inline_object.rs | 32 ++++ .../rust/src/models/inline_object_1.rs | 32 ++++ .../openapi3/client/petstore/python/setup.py | 2 +- .../ruby-faraday/lib/petstore/api/pet_api.rb | 10 +- .../lib/petstore/api/store_api.rb | 4 +- .../ruby-faraday/lib/petstore/api/user_api.rb | 6 +- 76 files changed, 583 insertions(+), 230 deletions(-) create mode 100644 modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java create mode 100644 samples/client/petstore/rust/docs/InlineObject.md create mode 100644 samples/client/petstore/rust/docs/InlineObject1.md create mode 100644 samples/client/petstore/rust/src/models/inline_object.rs create mode 100644 samples/client/petstore/rust/src/models/inline_object_1.rs diff --git a/bin/ruby-petstore-faraday.json b/bin/ruby-petstore-faraday.json index 21974c307f26..25c48b7aa628 100644 --- a/bin/ruby-petstore-faraday.json +++ b/bin/ruby-petstore-faraday.json @@ -2,5 +2,6 @@ "gemName": "petstore", "moduleName": "Petstore", "library": "faraday", - "gemVersion": "1.0.0" + "gemVersion": "1.0.0", + "strictSpecBehavior": false } diff --git a/bin/ruby-petstore.json b/bin/ruby-petstore.json index 47842a6be7a9..8e597283f8ba 100644 --- a/bin/ruby-petstore.json +++ b/bin/ruby-petstore.json @@ -2,5 +2,6 @@ "gemName": "petstore", "library": "typhoeus", "moduleName": "Petstore", - "gemVersion": "1.0.0" + "gemVersion": "1.0.0", + "strictSpecBehavior": false } diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java index 37d99044ba58..85fe76fe078b 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java @@ -421,13 +421,27 @@ public final class GeneratorSettings implements Serializable { builder.artifactId = copy.getArtifactId(); builder.artifactVersion = copy.getArtifactVersion(); builder.library = copy.getLibrary(); - builder.instantiationTypes = new HashMap<>(copy.getInstantiationTypes()); - builder.typeMappings = new HashMap<>(copy.getTypeMappings()); - builder.additionalProperties = new HashMap<>(copy.getAdditionalProperties()); - builder.importMappings = new HashMap<>(copy.getImportMappings()); - builder.languageSpecificPrimitives = new HashSet<>(copy.getLanguageSpecificPrimitives()); - builder.reservedWordMappings = new HashMap<>(copy.getReservedWordMappings()); - builder.serverVariables = new HashMap<>(copy.getServerVariables()); + if (copy.getInstantiationTypes() != null) { + builder.instantiationTypes.putAll(copy.getInstantiationTypes()); + } + if (copy.getTypeMappings() != null) { + builder.typeMappings.putAll(copy.getTypeMappings()); + } + if (copy.getAdditionalProperties() != null) { + builder.additionalProperties.putAll(copy.getAdditionalProperties()); + } + if (copy.getImportMappings() != null) { + builder.importMappings.putAll(copy.getImportMappings()); + } + if (copy.getLanguageSpecificPrimitives() != null) { + builder.languageSpecificPrimitives.addAll(copy.getLanguageSpecificPrimitives()); + } + if (copy.getReservedWordMappings() != null) { + builder.reservedWordMappings.putAll(copy.getReservedWordMappings()); + } + if (copy.getServerVariables() != null) { + builder.serverVariables.putAll(copy.getServerVariables()); + } builder.gitUserId = copy.getGitUserId(); builder.gitRepoId = copy.getGitRepoId(); builder.releaseNote = copy.getReleaseNote(); diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java index 2f506ac15ff2..bf13cacf7b21 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java @@ -33,38 +33,48 @@ import java.util.Objects; public class WorkflowSettings { private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowSettings.class); + public static final String DEFAULT_OUTPUT_DIR = "."; + public static final boolean DEFAULT_VERBOSE = false; + public static final boolean DEFAULT_SKIP_OVERWRITE = false; + public static final boolean DEFAULT_REMOVE_OPERATION_ID_PREFIX = false; + public static final boolean DEFAULT_LOG_TO_STDERR = false; + public static final boolean DEFAULT_VALIDATE_SPEC = true; + public static final boolean DEFAULT_ENABLE_POST_PROCESS_FILE = false; + public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false; + public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true; + public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache"; + public static final ImmutableMap DEFAULT_SYSTEM_PROPERTIES = ImmutableMap.of(); private String inputSpec; - private String outputDir; - private boolean verbose; - private boolean skipOverwrite; - private boolean removeOperationIdPrefix; - private boolean logToStderr; - private boolean validateSpec; - private boolean enablePostProcessFile; - private boolean enableMinimalUpdate; - private boolean strictSpecBehavior; + private String outputDir = DEFAULT_OUTPUT_DIR; + private boolean verbose = DEFAULT_VERBOSE; + private boolean skipOverwrite = DEFAULT_SKIP_OVERWRITE; + private boolean removeOperationIdPrefix = DEFAULT_REMOVE_OPERATION_ID_PREFIX; + private boolean logToStderr = DEFAULT_LOG_TO_STDERR; + private boolean validateSpec = DEFAULT_VALIDATE_SPEC; + private boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE; + private boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE; + private boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR; private String templateDir; - private String templatingEngineName; + private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; - private ImmutableMap systemProperties; + private ImmutableMap systemProperties = DEFAULT_SYSTEM_PROPERTIES; private WorkflowSettings(Builder builder) { - setDefaults(); - inputSpec = builder.inputSpec; - outputDir = builder.outputDir; - verbose = builder.verbose; - skipOverwrite = builder.skipOverwrite; - removeOperationIdPrefix = builder.removeOperationIdPrefix; - logToStderr = builder.logToStderr; - validateSpec = builder.validateSpec; - enablePostProcessFile = builder.enablePostProcessFile; - enableMinimalUpdate = builder.enableMinimalUpdate; - strictSpecBehavior = builder.strictSpecBehavior; - templateDir = builder.templateDir; - templatingEngineName = builder.templatingEngineName; - ignoreFileOverride = builder.ignoreFileOverride; - systemProperties = ImmutableMap.copyOf(builder.systemProperties); + this.inputSpec = builder.inputSpec; + this.outputDir = builder.outputDir; + this.verbose = builder.verbose; + this.skipOverwrite = builder.skipOverwrite; + this.removeOperationIdPrefix = builder.removeOperationIdPrefix; + this.logToStderr = builder.logToStderr; + this.validateSpec = builder.validateSpec; + this.enablePostProcessFile = builder.enablePostProcessFile; + this.enableMinimalUpdate = builder.enableMinimalUpdate; + this.strictSpecBehavior = builder.strictSpecBehavior; + this.templateDir = builder.templateDir; + this.templatingEngineName = builder.templatingEngineName; + this.ignoreFileOverride = builder.ignoreFileOverride; + this.systemProperties = ImmutableMap.copyOf(builder.systemProperties); } /** @@ -72,14 +82,7 @@ public class WorkflowSettings { */ @SuppressWarnings("unused") public WorkflowSettings() { - setDefaults(); - systemProperties = ImmutableMap.of(); - } - private void setDefaults(){ - validateSpec = true; - strictSpecBehavior = true; - outputDir = "."; } public static Builder newBuilder() { @@ -87,7 +90,7 @@ public class WorkflowSettings { } public static Builder newBuilder(WorkflowSettings copy) { - Builder builder = new Builder(); + Builder builder = newBuilder(); builder.inputSpec = copy.getInputSpec(); builder.outputDir = copy.getOutputDir(); builder.verbose = copy.isVerbose(); @@ -257,24 +260,24 @@ public class WorkflowSettings { @SuppressWarnings("unused") public static final class Builder { private String inputSpec; - private String outputDir; - private boolean verbose; - private boolean skipOverwrite; - private boolean removeOperationIdPrefix; - private boolean logToStderr; - private boolean validateSpec; - private boolean enablePostProcessFile; - private boolean enableMinimalUpdate; - private boolean strictSpecBehavior; + private String outputDir = DEFAULT_OUTPUT_DIR; + private Boolean verbose = DEFAULT_VERBOSE; + private Boolean skipOverwrite = DEFAULT_SKIP_OVERWRITE; + private Boolean removeOperationIdPrefix = DEFAULT_REMOVE_OPERATION_ID_PREFIX; + private Boolean logToStderr = DEFAULT_LOG_TO_STDERR; + private Boolean validateSpec = DEFAULT_VALIDATE_SPEC; + private Boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE; + private Boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE; + private Boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR; private String templateDir; - private String templatingEngineName; + private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; - private Map systemProperties; + private Map systemProperties = new HashMap<>();; private Builder() { - systemProperties = new HashMap<>(); } + /** * Sets the {@code inputSpec} and returns a reference to this Builder so that the methods can be chained together. * @@ -282,7 +285,9 @@ public class WorkflowSettings { * @return a reference to this Builder */ public Builder withInputSpec(String inputSpec) { - this.inputSpec = inputSpec; + if (inputSpec != null) { + this.inputSpec = inputSpec; + } return this; } @@ -293,7 +298,11 @@ public class WorkflowSettings { * @return a reference to this Builder */ public Builder withOutputDir(String outputDir) { - this.outputDir = Paths.get(outputDir).toAbsolutePath().toString();; + if (outputDir != null ) { + this.outputDir = Paths.get(outputDir).toAbsolutePath().toString(); + } else { + this.outputDir = DEFAULT_OUTPUT_DIR; + } return this; } @@ -303,8 +312,8 @@ public class WorkflowSettings { * @param verbose the {@code verbose} to set * @return a reference to this Builder */ - public Builder withVerbose(boolean verbose) { - this.verbose = verbose; + public Builder withVerbose(Boolean verbose) { + this.verbose = verbose != null ? verbose : Boolean.valueOf(DEFAULT_VERBOSE); return this; } @@ -314,8 +323,8 @@ public class WorkflowSettings { * @param skipOverwrite the {@code skipOverwrite} to set * @return a reference to this Builder */ - public Builder withSkipOverwrite(boolean skipOverwrite) { - this.skipOverwrite = skipOverwrite; + public Builder withSkipOverwrite(Boolean skipOverwrite) { + this.skipOverwrite = skipOverwrite != null ? skipOverwrite : Boolean.valueOf(DEFAULT_SKIP_OVERWRITE); return this; } @@ -325,8 +334,8 @@ public class WorkflowSettings { * @param removeOperationIdPrefix the {@code removeOperationIdPrefix} to set * @return a reference to this Builder */ - public Builder withRemoveOperationIdPrefix(boolean removeOperationIdPrefix) { - this.removeOperationIdPrefix = removeOperationIdPrefix; + public Builder withRemoveOperationIdPrefix(Boolean removeOperationIdPrefix) { + this.removeOperationIdPrefix = removeOperationIdPrefix != null ? removeOperationIdPrefix : Boolean.valueOf(DEFAULT_REMOVE_OPERATION_ID_PREFIX); return this; } @@ -336,8 +345,8 @@ public class WorkflowSettings { * @param logToStderr the {@code logToStderr} to set * @return a reference to this Builder */ - public Builder withLogToStderr(boolean logToStderr) { - this.logToStderr = logToStderr; + public Builder withLogToStderr(Boolean logToStderr) { + this.logToStderr = logToStderr != null ? logToStderr : Boolean.valueOf(DEFAULT_LOG_TO_STDERR); return this; } @@ -347,8 +356,8 @@ public class WorkflowSettings { * @param validateSpec the {@code validateSpec} to set * @return a reference to this Builder */ - public Builder withValidateSpec(boolean validateSpec) { - this.validateSpec = validateSpec; + public Builder withValidateSpec(Boolean validateSpec) { + this.validateSpec = validateSpec != null ? validateSpec : Boolean.valueOf(DEFAULT_VALIDATE_SPEC); return this; } @@ -358,8 +367,8 @@ public class WorkflowSettings { * @param enablePostProcessFile the {@code enablePostProcessFile} to set * @return a reference to this Builder */ - public Builder withEnablePostProcessFile(boolean enablePostProcessFile) { - this.enablePostProcessFile = enablePostProcessFile; + public Builder withEnablePostProcessFile(Boolean enablePostProcessFile) { + this.enablePostProcessFile = enablePostProcessFile != null ? enablePostProcessFile : Boolean.valueOf(DEFAULT_ENABLE_POST_PROCESS_FILE); return this; } @@ -369,8 +378,8 @@ public class WorkflowSettings { * @param enableMinimalUpdate the {@code enableMinimalUpdate} to set * @return a reference to this Builder */ - public Builder withEnableMinimalUpdate(boolean enableMinimalUpdate) { - this.enableMinimalUpdate = enableMinimalUpdate; + public Builder withEnableMinimalUpdate(Boolean enableMinimalUpdate) { + this.enableMinimalUpdate = enableMinimalUpdate != null ? enableMinimalUpdate : Boolean.valueOf(DEFAULT_ENABLE_MINIMAL_UPDATE); return this; } @@ -380,8 +389,8 @@ public class WorkflowSettings { * @param strictSpecBehavior the {@code strictSpecBehavior} to set * @return a reference to this Builder */ - public Builder withStrictSpecBehavior(boolean strictSpecBehavior) { - this.strictSpecBehavior = strictSpecBehavior; + public Builder withStrictSpecBehavior(Boolean strictSpecBehavior) { + this.strictSpecBehavior = strictSpecBehavior != null ? strictSpecBehavior : Boolean.valueOf(DEFAULT_STRICT_SPEC_BEHAVIOR); return this; } @@ -392,9 +401,7 @@ public class WorkflowSettings { * @return a reference to this Builder */ public Builder withTemplateDir(String templateDir) { - if (templateDir == null) { - this.templateDir = null; - } else { + if (templateDir != null) { File f = new File(templateDir); // check to see if the folder exists @@ -416,7 +423,7 @@ public class WorkflowSettings { * @return a reference to this Builder */ public Builder withTemplatingEngineName(String templatingEngineName) { - this.templatingEngineName = templatingEngineName; + this.templatingEngineName = templatingEngineName != null ? templatingEngineName : DEFAULT_TEMPLATING_ENGINE_NAME; return this; } @@ -438,7 +445,9 @@ public class WorkflowSettings { * @return a reference to this Builder */ public Builder withSystemProperties(Map systemProperties) { - this.systemProperties = systemProperties; + if (systemProperties != null) { + this.systemProperties = systemProperties; + } return this; } diff --git a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java new file mode 100644 index 000000000000..b958c9decf4a --- /dev/null +++ b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.config; + +import org.testng.annotations.Test; + +import java.nio.file.Paths; + +import static org.testng.Assert.*; + +public class WorkflowSettingsTest { + @Test + public void defaultValuesNotOverriddenByNulls(){ + WorkflowSettings settings = WorkflowSettings.newBuilder() + .withOutputDir(null) + .withVerbose(null) + .withSkipOverwrite(null) + .withRemoveOperationIdPrefix(null) + .withLogToStderr(null) + .withValidateSpec(null) + .withEnablePostProcessFile(null) + .withEnableMinimalUpdate(null) + .withStrictSpecBehavior(null) + .build(); + + assertEquals(settings.getOutputDir(), "."); + assertFalse(settings.isVerbose()); + assertFalse(settings.isSkipOverwrite()); + assertFalse(settings.isRemoveOperationIdPrefix()); + assertFalse(settings.isLogToStderr()); + assertTrue(settings.isValidateSpec()); + assertFalse(settings.isEnablePostProcessFile()); + assertFalse(settings.isEnableMinimalUpdate()); + assertTrue(settings.isStrictSpecBehavior()); + } + + private void assertOnChangesToDefaults(WorkflowSettings defaults) { + WorkflowSettings settings = WorkflowSettings.newBuilder() + .withOutputDir("output") + .withVerbose(true) + .withSkipOverwrite(true) + .withRemoveOperationIdPrefix(true) + .withLogToStderr(true) + .withValidateSpec(false) + .withEnablePostProcessFile(true) + .withEnableMinimalUpdate(true) + .withStrictSpecBehavior(false) + .build(); + + assertNotEquals(defaults.getOutputDir(), settings.getOutputDir()); + assertEquals(settings.getOutputDir(), Paths.get("output").toAbsolutePath().toString()); + + assertNotEquals(defaults.isVerbose(), settings.isVerbose()); + assertTrue(settings.isVerbose()); + + assertNotEquals(defaults.isSkipOverwrite(), settings.isSkipOverwrite()); + assertTrue(settings.isSkipOverwrite()); + + assertNotEquals(defaults.isRemoveOperationIdPrefix(), settings.isRemoveOperationIdPrefix()); + assertTrue(settings.isRemoveOperationIdPrefix()); + + assertNotEquals(defaults.isLogToStderr(), settings.isLogToStderr()); + assertTrue(settings.isLogToStderr()); + + assertNotEquals(defaults.isValidateSpec(), settings.isValidateSpec()); + assertFalse(settings.isValidateSpec()); + + assertNotEquals(defaults.isEnablePostProcessFile(), settings.isEnablePostProcessFile()); + assertTrue(settings.isEnablePostProcessFile()); + + assertNotEquals(defaults.isEnableMinimalUpdate(), settings.isEnableMinimalUpdate()); + assertTrue(settings.isEnableMinimalUpdate()); + + assertNotEquals(defaults.isStrictSpecBehavior(), settings.isStrictSpecBehavior()); + assertFalse(settings.isStrictSpecBehavior()); + } + + @Test + public void defaultValuesCanBeChangedClassConstructor(){ + WorkflowSettings defaults = new WorkflowSettings(); + assertOnChangesToDefaults(defaults); + } + + @Test + public void defaultValuesCanBeChangedBuilder(){ + WorkflowSettings defaults = WorkflowSettings.newBuilder().build(); + assertOnChangesToDefaults(defaults); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index 33030a80f199..b4a078e8b402 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -91,6 +91,7 @@ public class CodegenConfigurator { DynamicSettings settings = mapper.readValue(new File(configFile), DynamicSettings.class); CodegenConfigurator configurator = new CodegenConfigurator(); configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(settings.getGeneratorSettings()); + configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(settings.getWorkflowSettings()); return configurator; } catch (IOException ex) { LOGGER.error("Unable to deserialize config file: " + configFile, ex); diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index 83a328a9227e..2f81801b7943 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index e7b6b2ae4023..c3cbbb05666f 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -89,6 +89,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index 227bb2bf7888..57ea6d6d106e 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | @@ -684,3 +685,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## test_query_parameter_collection_format + +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pipe = ['pipe_example'] # Array | +ioutil = ['ioutil_example'] # Array | +http = ['http_example'] # Array | +url = ['url_example'] # Array | +context = ['context_example'] # Array | + +begin + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**Array<String>**](String.md)| | + **ioutil** | [**Array<String>**](String.md)| | + **http** | [**Array<String>**](String.md)| | + **url** | [**Array<String>**](String.md)| | + **context** | [**Array<String>**](String.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 52e3ec872474..8069935b8163 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index 36e3ce59b859..bd412b537593 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 72d18ee7ae0f..b6a04048e7ef 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end @@ -985,5 +985,92 @@ module Petstore end return data, status_code, headers end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [nil] + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + nil + end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' + end + # verify the required parameter 'pipe' is set + if @api_client.config.client_side_validation && pipe.nil? + fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'ioutil' is set + if @api_client.config.client_side_validation && ioutil.nil? + fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'http' is set + if @api_client.config.client_side_validation && http.nil? + fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'url' is set + if @api_client.config.client_side_validation && url.nil? + fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'context' is set + if @api_client.config.client_side_validation && context.nil? + fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" + end + # resource path + local_var_path = '/fake/test-query-paramters' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) + query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'url'] = @api_client.build_collection_param(url, :csv) + query_params[:'context'] = @api_client.build_collection_param(context, :multi) + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index 689a1beaebd1..8b025d270a45 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 65039a8af5dc..dfe49165feef 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 654e9d9fffdc..730420b65476 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index e0a28bbcdae3..8ed6369f5cac 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index bbb51dccb81c..7fa2f67e2f44 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,15 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end require 'date' -require 'faraday' require 'json' require 'logger' require 'tempfile' +require 'faraday' module Petstore class ApiClient @@ -46,37 +46,46 @@ module Petstore # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: # the data deserialized from response body (could be nil), response status code and response headers. def call_api(http_method, path, opts = {}) - connection = Faraday.new(:url => config.base_url) do |conn| + ssl_options = { + :ca_file => @config.ssl_ca_file, + :verify => @config.ssl_verify, + :verify_mode => @config.ssl_verify_mode, + :client_cert => @config.ssl_client_cert, + :client_key => @config.ssl_client_key + } + + connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| conn.basic_auth(config.username, config.password) if opts[:header_params]["Content-Type"] == "multipart/form-data" - conn.request :multipart - conn.request :url_encoded + conn.request :multipart + conn.request :url_encoded end conn.adapter(Faraday.default_adapter) end + begin - response = connection.public_send(http_method.to_sym.downcase) do |req| - build_request(http_method, path, req, opts) - end + response = connection.public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end - unless response.success? - if response.status == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.status, - :response_headers => response.headers, - :response_body => response.body), - response.reason_phrase - end + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.status, + :response_headers => response.headers, + :response_body => response.body), + response.reason_phrase end + end rescue Faraday::TimeoutError - fail ApiError.new('Connection timed out') + fail ApiError.new('Connection timed out') end if opts[:return_type] @@ -106,25 +115,15 @@ module Petstore update_params_for_auth! header_params, query_params, opts[:auth_names] - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - req_opts = { :method => http_method, :headers => header_params, :params => query_params, :params_encoding => @config.params_encoding, :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, :verbose => @config.debugging } - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) req_opts.update :body => req_body @@ -134,12 +133,44 @@ module Petstore end request.headers = header_params request.body = req_body - request.url path + request.url url request.params = query_params download_file(request) if opts[:return_type] == 'File' request end + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -277,36 +308,6 @@ module Petstore @config.base_url + path end - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Tempfile - data[key] = Faraday::UploadIO.new(value.path, '') - when ::Array, nil - # let Faraday handle Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - # Update hearder and query params based on authentication settings. # # @param [Hash] header_params Header parameters diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index 9eab46a89b75..06edcc78dc7e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 9fdb8b0e37fa..ae43bd936d20 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end @@ -86,33 +86,28 @@ module Petstore # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. # # @return [true, false] - attr_accessor :verify_ssl + attr_accessor :ssl_verify ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) # # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. # - # @return [true, false] - attr_accessor :verify_ssl_host + attr_accessor :ssl_verify_mode ### TLS/SSL setting # Set this to customize the certificate file to verify the peer. # # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert + attr_accessor :ssl_ca_file ### TLS/SSL setting # Client certificate file (for client certificate) - attr_accessor :cert_file + attr_accessor :ssl_client_cert ### TLS/SSL setting # Client private key file (for client certificate) - attr_accessor :key_file + attr_accessor :ssl_client_key # Set this to customize parameters encoding of array parameter with multi collectionFormat. # Default to nil. @@ -133,11 +128,11 @@ module Petstore @api_key_prefix = {} @timeout = 0 @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil @debugging = false @inject_format = false @force_ending_format = false diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb index d2af1ba5b32e..ceed16a9a1c0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb index 621e290e1577..59a3fc670ca2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb index 787951bf683a..f4922760aeaa 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 27f9768fb8da..4655656e140a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb index 5ed4bd9381ec..aa371aac26ad 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb index 3499c090be6d..72bf988f7f91 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb index fd957eb08f7d..d7db986a2148 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb index ca5e53859526..948fe37e8e79 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 396199ca4114..4bb43b9b3f2b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 998250d20ae6..b97381b8f3c7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 99aa9482fa3d..6524faab1bb1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index e7da1699d459..2cb6117756c3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 121bff2f0229..6e8b6c9c4155 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 02567bdfd45b..9e0b353acb07 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 51ab33355e3a..0e371fdab380 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index a971e6f55668..220f108d8cca 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 344ca690654d..8089f254d4f4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 01b2b965d608..8aa5d5272f21 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 830ab1d0f003..e70206c160d3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 07c31216bc38..19203ab642c8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 18cf61977204..e96ac0158024 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 1f12cb43b9c0..5b565597132f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index 406b0dccc950..e105ff447a8a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 0a2b987f345e..e9ce2639769f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 459e4deba8f0..6bce09460dc4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index c01bb104a3e8..7bb95e34fd20 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 4638d9f36e14..001e61e5181d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index 6d24ac174c59..e916d10b16ce 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index ab8318101b5b..db861f23f77d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 68509874a7d8..c8465b1823cf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f82bdde77211..7e5ed178810a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index d87939a4b8a7..552de582c698 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 32b75d1f0884..3aaa464c8e37 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 665fc3527641..302506441838 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 8b6da24af4b9..553ca99beb38 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index bcfc925dbf3f..c790d7027027 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index 1cfbf6659a7e..dd05f8ade309 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index c7d622d97034..d24a7b353ffe 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 20a476bbe9fb..59cbcadc5a6a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 012f382be799..beccaccac432 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index b2bc0dc84a62..f16178a214c2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 6d79193b09a2..700c27baf17d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb index 362ceff7a85f..4bf05bbf54c5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb index 63390983f381..2e541c9761ce 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 5b97445cc166..be6a8e9350a4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb index 9c26309da199..2894babc25cb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index 296454458383..37b31e0899a0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index 6cbf88ba127b..348b1213f447 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end @@ -31,8 +31,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") diff --git a/samples/client/petstore/rust/.openapi-generator/VERSION b/samples/client/petstore/rust/.openapi-generator/VERSION index 83a328a9227e..2f81801b7943 100644 --- a/samples/client/petstore/rust/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/docs/InlineObject.md b/samples/client/petstore/rust/docs/InlineObject.md new file mode 100644 index 000000000000..bfe33a4efb36 --- /dev/null +++ b/samples/client/petstore/rust/docs/InlineObject.md @@ -0,0 +1,12 @@ +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/docs/InlineObject1.md b/samples/client/petstore/rust/docs/InlineObject1.md new file mode 100644 index 000000000000..930d10cdcbf3 --- /dev/null +++ b/samples/client/petstore/rust/docs/InlineObject1.md @@ -0,0 +1,12 @@ +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**file** | [***std::path::PathBuf**](std::path::PathBuf.md) | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/src/models/inline_object.rs b/samples/client/petstore/rust/src/models/inline_object.rs new file mode 100644 index 000000000000..b1444810dcff --- /dev/null +++ b/samples/client/petstore/rust/src/models/inline_object.rs @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct InlineObject { + /// Updated name of the pet + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Updated status of the pet + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl InlineObject { + pub fn new() -> InlineObject { + InlineObject { + name: None, + status: None, + } + } +} + + diff --git a/samples/client/petstore/rust/src/models/inline_object_1.rs b/samples/client/petstore/rust/src/models/inline_object_1.rs new file mode 100644 index 000000000000..ee4c1b78ae57 --- /dev/null +++ b/samples/client/petstore/rust/src/models/inline_object_1.rs @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct InlineObject1 { + /// Additional data to pass to server + #[serde(rename = "additionalMetadata", skip_serializing_if = "Option::is_none")] + pub additional_metadata: Option, + /// file to upload + #[serde(rename = "file", skip_serializing_if = "Option::is_none")] + pub file: Option, +} + +impl InlineObject1 { + pub fn new() -> InlineObject1 { + InlineObject1 { + additional_metadata: None, + file: None, + } + } +} + + diff --git a/samples/openapi3/client/petstore/python/setup.py b/samples/openapi3/client/petstore/python/setup.py index 86988b6d42e0..1d5e7c2915ef 100644 --- a/samples/openapi3/client/petstore/python/setup.py +++ b/samples/openapi3/client/petstore/python/setup.py @@ -31,7 +31,7 @@ setup( url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 1046df37b6d9..9f36b7256f88 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -103,7 +103,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -290,7 +290,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -414,7 +414,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -480,7 +480,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" end # resource path - local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -552,7 +552,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" end # resource path - local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 9e577bbf5342..e53d5820f395 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -43,7 +43,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" end # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -167,7 +167,7 @@ module Petstore end # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)) # query parameters query_params = opts[:query_params] || {} diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 51cee2bc4e86..70dcc6cf26d5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -225,7 +225,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -283,7 +283,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -471,7 +471,7 @@ module Petstore fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {}