From e2251084f22775800ecd81de1936aa6f0b046859 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 5 May 2018 00:10:34 +0800 Subject: [PATCH] Update the default value of Ruby client generator (#320) * fix ruby client default value * fix example value for ruby --- .../codegen/languages/RubyClientCodegen.java | 9 +++------ .../src/main/resources/ruby/base_object.mustache | 2 +- .../resources/ruby/base_object_spec.mustache | 2 +- .../ruby/partial_model_generic.mustache | 2 +- samples/client/petstore/ruby/.gitignore | 2 +- samples/client/petstore/ruby/.rubocop.yml | 2 +- samples/client/petstore/ruby/README.md | 2 +- samples/client/petstore/ruby/docs/AnimalFarm.md | 7 +++++++ samples/client/petstore/ruby/docs/FakeApi.md | 12 ++++++------ samples/client/petstore/ruby/git_push.sh | 4 ++-- samples/client/petstore/ruby/lib/petstore.rb | 4 ++-- .../ruby/lib/petstore/api/another_fake_api.rb | 4 ++-- .../petstore/ruby/lib/petstore/api/fake_api.rb | 16 ++++++++-------- .../petstore/api/fake_classname_tags123_api.rb | 4 ++-- .../petstore/ruby/lib/petstore/api/pet_api.rb | 4 ++-- .../petstore/ruby/lib/petstore/api/store_api.rb | 4 ++-- .../petstore/ruby/lib/petstore/api/user_api.rb | 4 ++-- .../petstore/ruby/lib/petstore/api_client.rb | 8 ++++---- .../petstore/ruby/lib/petstore/api_error.rb | 4 ++-- .../petstore/ruby/lib/petstore/configuration.rb | 4 ++-- .../models/additional_properties_class.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/animal.rb | 8 ++++---- .../ruby/lib/petstore/models/animal_farm.rb | 8 ++++---- .../ruby/lib/petstore/models/api_response.rb | 8 ++++---- .../models/array_of_array_of_number_only.rb | 8 ++++---- .../lib/petstore/models/array_of_number_only.rb | 8 ++++---- .../ruby/lib/petstore/models/array_test.rb | 8 ++++---- .../ruby/lib/petstore/models/capitalization.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/cat.rb | 8 ++++---- .../ruby/lib/petstore/models/category.rb | 8 ++++---- .../ruby/lib/petstore/models/class_model.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/client.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/dog.rb | 8 ++++---- .../ruby/lib/petstore/models/enum_arrays.rb | 8 ++++---- .../ruby/lib/petstore/models/enum_class.rb | 4 ++-- .../ruby/lib/petstore/models/enum_test.rb | 8 ++++---- .../ruby/lib/petstore/models/format_test.rb | 8 ++++---- .../lib/petstore/models/has_only_read_only.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/list.rb | 8 ++++---- .../ruby/lib/petstore/models/map_test.rb | 8 ++++---- ...properties_and_additional_properties_class.rb | 8 ++++---- .../lib/petstore/models/model200_response.rb | 8 ++++---- .../ruby/lib/petstore/models/model_return.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/name.rb | 8 ++++---- .../ruby/lib/petstore/models/number_only.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/order.rb | 8 ++++---- .../ruby/lib/petstore/models/outer_composite.rb | 8 ++++---- .../ruby/lib/petstore/models/outer_enum.rb | 4 ++-- .../petstore/ruby/lib/petstore/models/pet.rb | 8 ++++---- .../ruby/lib/petstore/models/read_only_first.rb | 8 ++++---- .../lib/petstore/models/special_model_name.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/tag.rb | 8 ++++---- .../petstore/ruby/lib/petstore/models/user.rb | 8 ++++---- .../client/petstore/ruby/lib/petstore/version.rb | 4 ++-- samples/client/petstore/ruby/petstore.gemspec | 8 ++++---- 55 files changed, 186 insertions(+), 182 deletions(-) create mode 100644 samples/client/petstore/ruby/docs/AnimalFarm.md diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 0c1e2066482..67ad0533626 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -17,11 +17,9 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.*; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenType; @@ -32,11 +30,9 @@ import org.openapitools.codegen.utils.ModelUtils; import java.io.File; import java.util.Arrays; import java.util.Iterator; -import java.util.List; import java.util.Map; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.*; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -584,7 +580,8 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig { if (p.defaultValue == null) { example = p.example; } else { - example = p.defaultValue; + p.example = p.defaultValue; + return; } String type = p.baseType; diff --git a/modules/openapi-generator/src/main/resources/ruby/base_object.mustache b/modules/openapi-generator/src/main/resources/ruby/base_object.mustache index 10b51530eed..815f5078fc7 100644 --- a/modules/openapi-generator/src/main/resources/ruby/base_object.mustache +++ b/modules/openapi-generator/src/main/resources/ruby/base_object.mustache @@ -3,7 +3,7 @@ # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/modules/openapi-generator/src/main/resources/ruby/base_object_spec.mustache b/modules/openapi-generator/src/main/resources/ruby/base_object_spec.mustache index 7376cd1e84d..50778a95a29 100644 --- a/modules/openapi-generator/src/main/resources/ruby/base_object_spec.mustache +++ b/modules/openapi-generator/src/main/resources/ruby/base_object_spec.mustache @@ -16,7 +16,7 @@ class ArrayMapObject < Petstore::Category } end - def self.swagger_types + def self.openapi_types { :int_arr => :'Array', :pet_arr => :'Array', diff --git a/modules/openapi-generator/src/main/resources/ruby/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/ruby/partial_model_generic.mustache index 6302db5303f..8332f7c25a7 100644 --- a/modules/openapi-generator/src/main/resources/ruby/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/ruby/partial_model_generic.mustache @@ -43,7 +43,7 @@ end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { {{#vars}} :'{{{name}}}' => :'{{{datatype}}}'{{#hasMore}},{{/hasMore}} diff --git a/samples/client/petstore/ruby/.gitignore b/samples/client/petstore/ruby/.gitignore index c021594bf3f..05a17cb8f0a 100644 --- a/samples/client/petstore/ruby/.gitignore +++ b/samples/client/petstore/ruby/.gitignore @@ -1,4 +1,4 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git +# Generated by: https://openapi-generator.tech # *.gem diff --git a/samples/client/petstore/ruby/.rubocop.yml b/samples/client/petstore/ruby/.rubocop.yml index 19a777e1615..9bc9d341d8b 100644 --- a/samples/client/petstore/ruby/.rubocop.yml +++ b/samples/client/petstore/ruby/.rubocop.yml @@ -1,5 +1,5 @@ # This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) +# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) AllCops: TargetRubyVersion: 2.2 # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 0d253cd609c..90e3315a17d 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -4,7 +4,7 @@ Petstore - the Ruby gem for the Swagger Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 - Package version: 1.0.0 diff --git a/samples/client/petstore/ruby/docs/AnimalFarm.md b/samples/client/petstore/ruby/docs/AnimalFarm.md new file mode 100644 index 00000000000..30d704dc7d1 --- /dev/null +++ b/samples/client/petstore/ruby/docs/AnimalFarm.md @@ -0,0 +1,7 @@ +# Petstore::AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 9bc24f0ab75..f48e54f49da 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -30,7 +30,7 @@ require 'petstore' api_instance = Petstore::FakeApi.new opts = { - boolean_post_body: true # BOOLEAN | Input boolean as post body + body: true # BOOLEAN | Input boolean as post body } begin @@ -45,7 +45,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **boolean_post_body** | **BOOLEAN**| Input boolean as post body | [optional] + **body** | **BOOLEAN**| Input boolean as post body | [optional] ### Return type @@ -387,7 +387,7 @@ opts = { enum_query_integer: 56, # Integer | Query parameter enum test (double) enum_query_double: 3.4, # Float | Query parameter enum test (double) enum_form_string_array: nil, # Array | Form parameter enum test (string array) - enum_form_string: 'enum_form_string_example' # String | Form parameter enum test (string) + enum_form_string: '-efg' # String | Form parameter enum test (string) } begin @@ -403,13 +403,13 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**Array<String>**](String.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **String**| Header parameter enum test (string) | [optional] [default to -efg] + **enum_header_string** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] **enum_query_string_array** | [**Array<String>**](String.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **String**| Query parameter enum test (string) | [optional] [default to -efg] + **enum_query_string** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] **enum_query_integer** | **Integer**| Query parameter enum test (double) | [optional] **enum_query_double** | **Float**| Query parameter enum test (double) | [optional] **enum_form_string_array** | [**Array<String>**](Array.md)| Form parameter enum test (string array) | [optional] - **enum_form_string** | **String**| Form parameter enum test (string) | [optional] + **enum_form_string** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] ### Return type diff --git a/samples/client/petstore/ruby/git_push.sh b/samples/client/petstore/ruby/git_push.sh index 89eb49eca9c..b9fd6af8e05 100644 --- a/samples/client/petstore/ruby/git_push.sh +++ b/samples/client/petstore/ruby/git_push.sh @@ -1,10 +1,10 @@ #!/bin/sh # -# Generated by: https://github.com/swagger-api/swagger-codegen.git +# Generated by: https://openapi-generator.tech # # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index dd4bad3ee25..d24c3b1d3fc 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index 5bae9d76912..9d57e423167 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 9a81cec992d..d0cd7367e65 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -21,7 +21,7 @@ module Petstore end # Test serialization of outer boolean types # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :boolean_post_body Input boolean as post body + # @option opts [BOOLEAN] :body Input boolean as post body # @return [BOOLEAN] def fake_outer_boolean_serialize(opts = {}) data, _status_code, _headers = fake_outer_boolean_serialize_with_http_info(opts) @@ -30,7 +30,7 @@ module Petstore # Test serialization of outer boolean types # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :boolean_post_body Input boolean as post body + # @option opts [BOOLEAN] :body Input boolean as post body # @return [Array<(BOOLEAN, Fixnum, Hash)>] BOOLEAN data, response status code and response headers def fake_outer_boolean_serialize_with_http_info(opts = {}) if @api_client.config.debugging @@ -51,7 +51,7 @@ module Petstore form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'boolean_post_body']) + post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -470,13 +470,13 @@ module Petstore # To test enum parameters # @param [Hash] opts the optional parameters # @option opts [Array] :enum_header_string_array Header parameter enum test (string array) - # @option opts [String] :enum_header_string Header parameter enum test (string) (default to -efg) + # @option opts [String] :enum_header_string Header parameter enum test (string) (default to '-efg') # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) - # @option opts [String] :enum_query_string Query parameter enum test (string) (default to -efg) + # @option opts [String] :enum_query_string Query parameter enum test (string) (default to '-efg') # @option opts [Integer] :enum_query_integer Query parameter enum test (double) # @option opts [Float] :enum_query_double Query parameter enum test (double) # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) - # @option opts [String] :enum_form_string Form parameter enum test (string) + # @option opts [String] :enum_form_string Form parameter enum test (string) (default to '-efg') # @return [nil] def test_enum_parameters(opts = {}) test_enum_parameters_with_http_info(opts) diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 1e2542794fd..68c57a255ed 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index f7cb89a7a68..524c8f8693a 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 6dcbbe74b76..562542341b2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index 7b8c2ecf72f..08bf916a403 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 31eace6c218..c6d6bc43042 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -31,7 +31,7 @@ module Petstore # @option config [Configuration] Configuration for initializing the object, default to Configuration.default def initialize(config = Configuration.default) @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" + @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent @@ -314,7 +314,7 @@ module Petstore # Sets user agent in HTTP header # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) def user_agent=(user_agent) @user_agent = user_agent @default_headers['User-Agent'] = @user_agent diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index fa72e0ec618..3558f090206 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 7abc60e43e8..401bc237eef 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 3a3539c708a..8b79c4acf3e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -27,7 +27,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'map_property' => :'Hash', :'map_of_map_property' => :'Hash>' @@ -94,7 +94,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 95658fba6a9..397341e5fdb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -27,7 +27,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'class_name' => :'String', :'color' => :'String' @@ -97,7 +97,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb index c3e8c55049c..8df376523a6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -21,7 +21,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { } end @@ -72,7 +72,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 1f5a336a8b6..46101deb0f8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -30,7 +30,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'code' => :'Integer', :'type' => :'String', @@ -99,7 +99,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index df47cecca8b..16df751d090 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -24,7 +24,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'array_array_number' => :'Array>' } @@ -83,7 +83,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index e4f51d61bcc..b7a85f42106 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -24,7 +24,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'array_number' => :'Array' } @@ -83,7 +83,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index c4dcf73e2f5..a02053ab175 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -30,7 +30,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'array_of_string' => :'Array', :'array_array_of_integer' => :'Array>', @@ -105,7 +105,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 1f0cf3cf38f..4d846ef3589 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -40,7 +40,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'small_camel' => :'String', :'capital_camel' => :'String', @@ -127,7 +127,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index d890053ac6e..527ad131539 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -30,7 +30,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'class_name' => :'String', :'color' => :'String', @@ -106,7 +106,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index fe12e55c5eb..d3b01d0e7ca 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -27,7 +27,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String' @@ -90,7 +90,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index d8d7b8a26dd..88df3525bfe 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -25,7 +25,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'_class' => :'String' } @@ -82,7 +82,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 9416ef2cfc6..aaa3f083993 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -24,7 +24,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'client' => :'String' } @@ -81,7 +81,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index f31797c3d40..7a09171cb22 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -30,7 +30,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'class_name' => :'String', :'color' => :'String', @@ -106,7 +106,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 0ae0820829d..1772e30d290 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -49,7 +49,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'just_symbol' => :'String', :'array_enum' => :'Array' @@ -126,7 +126,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index 7af2bc08273..7b3dc3a668a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index 3ae49edf31a..97553eac415 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -58,7 +58,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'enum_string' => :'String', :'enum_string_required' => :'String', @@ -192,7 +192,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index c995a6d8941..1590680ce92 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -60,7 +60,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'integer' => :'Integer', :'int32' => :'Integer', @@ -395,7 +395,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 7cf9cf65d68..5cb100da59d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -27,7 +27,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'bar' => :'String', :'foo' => :'String' @@ -90,7 +90,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index dce0c4241d7..dd971425bad 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -24,7 +24,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'_123_list' => :'String' } @@ -81,7 +81,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 15735a8842e..459b5cfe304 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -49,7 +49,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'map_map_of_string' => :'Hash>', :'map_of_enum_string' => :'Hash' @@ -116,7 +116,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index a61f3332e83..fab2b56b992 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -30,7 +30,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'uuid' => :'String', :'date_time' => :'DateTime', @@ -101,7 +101,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 808ae04a515..e3b66e252bc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -28,7 +28,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'Integer', :'_class' => :'String' @@ -91,7 +91,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index 8c464bfdd90..31ee474fb7d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -25,7 +25,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'_return' => :'Integer' } @@ -82,7 +82,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index b2a1b2e3373..cd2726d194a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -34,7 +34,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'Integer', :'snake_case' => :'Integer', @@ -114,7 +114,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index b84989631bb..1f4fb22e4e9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -24,7 +24,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'just_number' => :'Float' } @@ -81,7 +81,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index dd6166a57ce..1e6fb1791b5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -62,7 +62,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'pet_id' => :'Integer', @@ -163,7 +163,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index 8cc58b42c22..cbe55f340ed 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -30,7 +30,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'my_number' => :'Float', :'my_string' => :'String', @@ -99,7 +99,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index a5eebb86703..f7f23ce890d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 2a9599727ea..329d17ea5b3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -62,7 +62,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'category' => :'Category', @@ -175,7 +175,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index cdbbf40fe28..2a3f891af2e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -27,7 +27,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'bar' => :'String', :'baz' => :'String' @@ -90,7 +90,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index c812189814c..5f786f120a0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -24,7 +24,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'special_property_name' => :'Integer' } @@ -81,7 +81,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 2ea5c142355..58c27418a47 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -27,7 +27,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String' @@ -90,7 +90,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 4e201064390..9b4be21b7a3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -46,7 +46,7 @@ module Petstore end # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'username' => :'String', @@ -145,7 +145,7 @@ module Petstore # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| + self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index 6e6949d9bc4..140948ac770 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -5,8 +5,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index ae1c54eacb8..22e7ae798a2 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -7,8 +7,8 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.0-SNAPSHOT =end @@ -19,9 +19,9 @@ Gem::Specification.new do |s| s.name = "petstore" s.version = Petstore::VERSION s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] + s.authors = ["OpenAPI-Generator"] s.email = ["apiteam@swagger.io"] - s.homepage = "https://github.com/swagger-api/swagger-codegen" + s.homepage = "https://openapi-generator.tech" s.summary = "Swagger Petstore Ruby Gem" s.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: \" \\" s.license = "Unlicense"