diff --git a/pom.xml b/pom.xml index 5504ecaab2d..c635e1edab5 100644 --- a/pom.xml +++ b/pom.xml @@ -827,8 +827,8 @@ samples/client/petstore/typescript-fetch/builds/es6-target samples/client/petstore/typescript-fetch/builds/with-npm-version samples/client/petstore/typescript-fetch/tests/default - samples/client/petstore/typescript-angular samples/client/petstore/typescript-angular2/npm samples/client/petstore/typescript-angular4/npm diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index 7ffa53d7cd8..aca3b5b6e33 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -69,7 +69,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *body = [[Pet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index e617ed00dc0..805608667d5 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -194,7 +194,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; - } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -252,7 +251,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; - } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h index aba4f712480..160295b0f3a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h @@ -16,6 +16,7 @@ + @protocol SWGCategory @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents index 4ed558fee25..4ec7a3b456b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents @@ -1,11 +1,6 @@ - - - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h index d8a48516b78..c0321482a09 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h @@ -16,6 +16,7 @@ + @protocol SWGOrder @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h index 0db2ead28dc..4b026d071c1 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h @@ -16,6 +16,11 @@ #import "SWGCategory.h" #import "SWGTag.h" +@protocol SWGCategory; +@class SWGCategory; +@protocol SWGTag; +@class SWGTag; + @protocol SWGPet diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h index 05844b7438e..6a742d3c9dd 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h @@ -16,6 +16,7 @@ + @protocol SWGTag @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h index 4db4b03f1b4..31a524dc7f0 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h @@ -16,6 +16,7 @@ + @protocol SWGUser @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index e617ed00dc0..805608667d5 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -194,7 +194,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; - } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -252,7 +251,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; - } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; diff --git a/samples/client/petstore/ruby/.swagger-codegen/VERSION b/samples/client/petstore/ruby/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore/ruby/.swagger-codegen/VERSION +++ b/samples/client/petstore/ruby/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 5be8b172087..0ac1c9df25d 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -82,6 +82,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *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/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index ebb6f8660fc..97c2efb11c2 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data # **fake_outer_boolean_serialize** @@ -392,3 +393,52 @@ No authorization required +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + + + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +param = "param_example" # String | field1 + +param2 = "param2_example" # String | field2 + + +begin + #test json serialization of form data + api_instance.test_json_form_data(param, param2) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_json_form_data: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + + diff --git a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md index 8982f1ff736..c8f005d8d3b 100644 --- a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 6207d0016bf..605e44333dd 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.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 adf79a57448..7951ac39df8 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end @@ -516,5 +516,65 @@ module Petstore end return data, status_code, headers end + + # test json serialization of form data + # + # @param param field1 + # @param param2 field2 + # @param [Hash] opts the optional parameters + # @return [nil] + def test_json_form_data(param, param2, opts = {}) + test_json_form_data_with_http_info(param, param2, opts) + return nil + end + + # test json serialization of form data + # + # @param param field1 + # @param param2 field2 + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_json_form_data_with_http_info(param, param2, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: FakeApi.test_json_form_data ..." + end + # verify the required parameter 'param' is set + if @api_client.config.client_side_validation && param.nil? + fail ArgumentError, "Missing the required parameter 'param' when calling FakeApi.test_json_form_data" + end + # verify the required parameter 'param2' is set + if @api_client.config.client_side_validation && param2.nil? + fail ArgumentError, "Missing the required parameter 'param2' when calling FakeApi.test_json_form_data" + end + # resource path + local_var_path = "/fake/jsonFormData" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + form_params["param"] = param + form_params["param2"] = param2 + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_json_form_data\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/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index ea58b920fc2..2778d7714c7 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 @@ -6,6 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.3.0-SNAPSHOT =end @@ -39,7 +40,9 @@ module Petstore @api_client.config.logger.debug "Calling API: FakeClassnameTags123Api.test_classname ..." end # verify the required parameter 'body' is set - fail ArgumentError, "Missing the required parameter 'body' when calling FakeClassnameTags123Api.test_classname" if body.nil? + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FakeClassnameTags123Api.test_classname" + end # resource path local_var_path = "/fake_classname_test" 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 db02c4f4ef3..f25b913dc4d 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.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 4b7ce13c894..1f78fe59a41 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.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 a71e20528ba..854bff45feb 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.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 6be0bf6f571..65a161c2c05 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index 048b6aaa35d..67a90b0bfe7 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index f1c706e4aec..37fdb07ca49 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.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 2ba825293da..e5d7fb8f24b 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index b978f144b60..bf20e65fd04 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 199840dd7d7..e128e2063d9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 035d0bbcc95..c751315132a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 53cc21811c8..0a79c0157d2 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 dbd9b529866..8c0fca8c8ea 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 5c99ff77be0..3b98169dd37 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 3bb6786f071..64cf3568810 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index dde66d52eb8..ebb0aa151fe 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 8f8edfd3fb4..8b44bdec614 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 018f48a2f76..819443e13fe 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 88fedfa2214..5291284ca7b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index 07d3b947073..0a261ed647d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 c4261f46185..f739262f89b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 7c172cd41f9..977a572e91c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end @@ -18,6 +18,15 @@ module Petstore ABC = "_abc".freeze EFG = "-efg".freeze XYZ = "(xyz)".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + consantValues = EnumClass.constants.select{|c| c.to_s == value} + raise "Invalid ENUM value #{value} for class #EnumClass" if consantValues.empty? + value + end end 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 bcbc5d116d0..c55cd3314dd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 5c2e7513d4c..a63563108d3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 ce48529f282..b934195ee41 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 02801eaddf2..5fa2ce4b9fd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 5f1b28e0717..9510ce2a93c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 8019ba729ec..f16ce716f33 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb index 3808ef8fdb7..637654548ac 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 60553b3e4d9..0011ec23173 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index 76eb557074c..62d811f57a8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 1cad525e33d..04107a0c673 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 68e592cc29c..18c9495b03e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb index c94636a6d5a..18941d2c473 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 5e7765b4521..01872451088 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 cd008226cf7..713498c0aaa 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end @@ -18,6 +18,15 @@ module Petstore PLACED = "placed".freeze APPROVED = "approved".freeze DELIVERED = "delivered".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + consantValues = OuterEnum.constants.select{|c| c.to_s == value} + raise "Invalid ENUM value #{value} for class #OuterEnum" if consantValues.empty? + value + end end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb index 6e81499d8df..229013f1c2d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb index adb83e55f42..a3152e2f95c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.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 cae1a9cf6e7..64289aef423 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 753681c1df1..61f092338bc 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end 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 96352a1d44c..19d24356a28 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 0c465d29a1e..44920c3b135 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index e46c311e328..28996f1af96 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index ba5adc132a9..d8988af1af6 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index 3dd54d3107f..5971503b533 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.2.3-SNAPSHOT +Swagger Codegen version: 2.3.0-SNAPSHOT =end