diff --git a/bin/openapi3/ruby-client-faraday-petstore.sh b/bin/openapi3/ruby-client-faraday-petstore.sh deleted file mode 100755 index 4110205ea159..000000000000 --- a/bin/openapi3/ruby-client-faraday-petstore.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# purge lib/doc folder -echo "purge ruby petstore lib, docs folder" -rm -Rf samples/openapi3/client/petstore/ruby-faraday/lib -rm -Rf samples/openapi3/client/petstore/ruby-faraday/docs - -# purge test files other than integration test -# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files -echo "purge ruby petstore spec" -find samples/openapi3/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf -find samples/openapi3/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/openapi3/ruby-petstore-faraday.json -o samples/openapi3/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/ruby-client-petstore.sh b/bin/openapi3/ruby-client-petstore.sh deleted file mode 100755 index 0be84e7eca84..000000000000 --- a/bin/openapi3/ruby-client-petstore.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# purge lib/doc folder -echo "purge ruby petstore lib, docs folder" -rm -Rf samples/openapi3/client/petstore/ruby/lib -rm -Rf samples/openapi3/client/petstore/ruby/docs - -# purge test files other than integration test -# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files -echo "purge ruby petstore spec" -find samples/openapi3/client/petstore/ruby/spec -type d -not -name spec -not -name custom | xargs rm -Rf -find samples/openapi3/client/petstore/ruby/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/openapi3/client/petstore/ruby --additional-properties skipFormModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/ruby-on-rails-server-petstore.sh b/bin/openapi3/ruby-on-rails-server-petstore.sh deleted file mode 100755 index 3cb83a0c517f..000000000000 --- a/bin/openapi3/ruby-on-rails-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/ruby-petstore-faraday.json b/bin/openapi3/ruby-petstore-faraday.json deleted file mode 100644 index 21974c307f26..000000000000 --- a/bin/openapi3/ruby-petstore-faraday.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "gemName": "petstore", - "moduleName": "Petstore", - "library": "faraday", - "gemVersion": "1.0.0" -} diff --git a/bin/openapi3/ruby-sinatra-server-petstore.sh b/bin/openapi3/ruby-sinatra-server-petstore.sh deleted file mode 100755 index 88701e48793e..000000000000 --- a/bin/openapi3/ruby-sinatra-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-client-petstore-faraday.sh b/bin/ruby-client-petstore-faraday.sh index 6782f410e469..3a8afdd28d11 100755 --- a/bin/ruby-client-petstore-faraday.sh +++ b/bin/ruby-client-petstore-faraday.sh @@ -22,11 +22,22 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" if [ ! -f "$executable" ] then - mvn -B clean package + mvn clean package fi +# purge lib/doc folder +echo "purge ruby petstore lib, docs folder" +rm -Rf samples/client/petstore/ruby-faraday/lib +rm -Rf samples/client/petstore/ruby-faraday/docs + +# purge test files other than integration test +# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files +echo "purge ruby petstore spec" +find samples/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf +find samples/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf + # if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday $@" +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-client-petstore.sh b/bin/ruby-client-petstore.sh index 2b1aa3c64c86..292d70a443a0 100755 --- a/bin/ruby-client-petstore.sh +++ b/bin/ruby-client-petstore.sh @@ -22,16 +22,22 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" if [ ! -f "$executable" ] then - mvn -B clean package + mvn clean package fi -echo "purge ruby petstore lib, docs, spec folder" +# purge lib/doc folder +echo "purge ruby petstore lib, docs folder" rm -Rf samples/client/petstore/ruby/lib rm -Rf samples/client/petstore/ruby/docs -rm -Rf samples/client/petstore/ruby/spec + +# purge test files other than integration test +# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files +echo "purge ruby petstore spec" +find samples/client/petstore/ruby/spec -type d -not -name spec -not -name custom | xargs rm -Rf +find samples/client/petstore/ruby/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@" +ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby --additional-properties skipFormModel=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-on-rails-server-petstore.sh b/bin/ruby-on-rails-server-petstore.sh index f489944db232..3cb83a0c517f 100755 --- a/bin/ruby-on-rails-server-petstore.sh +++ b/bin/ruby-on-rails-server-petstore.sh @@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" if [ ! -f "$executable" ] then - mvn -B clean package + mvn clean package fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@" +ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-petstore-faraday.json b/bin/ruby-petstore-faraday.json index 25c48b7aa628..21974c307f26 100644 --- a/bin/ruby-petstore-faraday.json +++ b/bin/ruby-petstore-faraday.json @@ -2,6 +2,5 @@ "gemName": "petstore", "moduleName": "Petstore", "library": "faraday", - "gemVersion": "1.0.0", - "strictSpecBehavior": false + "gemVersion": "1.0.0" } diff --git a/bin/ruby-sinatra-server-petstore.sh b/bin/ruby-sinatra-server-petstore.sh index a5d164bf8267..88701e48793e 100755 --- a/bin/ruby-sinatra-server-petstore.sh +++ b/bin/ruby-sinatra-server-petstore.sh @@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" if [ ! -f "$executable" ] then - mvn -B clean package + mvn clean package fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@" +ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index ff9425a3a625..df1f7a32d687 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -24,8 +24,6 @@ sleep 5 declare -a samples=( "${root}/bin/ruby-client-petstore.sh" "${root}/bin/ruby-client-petstore-faraday.sh" -"${root}/bin/openapi3/ruby-client-petstore.sh" -"${root}/bin/openapi3/ruby-client-faraday-petstore.sh" "${root}/bin/java-petstore-all.sh" "${root}/bin/java-jaxrs-petstore-server-all.sh" "${root}/bin/java-msf4j-petstore-server.sh" diff --git a/pom.xml b/pom.xml index 71ab5328fc05..ad6d60e0ea9e 100644 --- a/pom.xml +++ b/pom.xml @@ -1087,7 +1087,6 @@ samples/client/petstore/python - go-client @@ -1387,7 +1385,7 @@ samples/server/petstore/go-api-server samples/server/petstore/go-gin-api-server - samples/openapi3/client/petstore/ruby + samples/client/petstore/ruby samples/openapi3/client/petstore/scala-akka samples/client/petstore/dart2/petstore diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index 12f67a491375..61a40c4b9a02 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -5,28 +5,20 @@ Gemfile README.md Rakefile -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md docs/Animal.md docs/AnotherFakeApi.md docs/ApiResponse.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md docs/Capitalization.md docs/Cat.md docs/CatAllOf.md docs/Category.md docs/ClassModel.md docs/Client.md +docs/DefaultApi.md docs/Dog.md docs/DogAllOf.md docs/EnumArrays.md @@ -36,32 +28,43 @@ docs/FakeApi.md docs/FakeClassnameTags123Api.md docs/File.md docs/FileSchemaTestClass.md +docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md docs/List.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md docs/ModelReturn.md docs/Name.md +docs/NullableClass.md docs/NumberOnly.md docs/Order.md docs/OuterComposite.md docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md docs/User.md docs/UserApi.md -docs/XmlItem.md git_push.sh lib/petstore.rb lib/petstore/api/another_fake_api.rb +lib/petstore/api/default_api.rb lib/petstore/api/fake_api.rb lib/petstore/api/fake_classname_tags123_api.rb lib/petstore/api/pet_api.rb @@ -71,21 +74,12 @@ lib/petstore/api_client.rb lib/petstore/api_error.rb lib/petstore/configuration.rb lib/petstore/configuration.rb -lib/petstore/models/additional_properties_any_type.rb -lib/petstore/models/additional_properties_array.rb -lib/petstore/models/additional_properties_boolean.rb lib/petstore/models/additional_properties_class.rb -lib/petstore/models/additional_properties_integer.rb -lib/petstore/models/additional_properties_number.rb -lib/petstore/models/additional_properties_object.rb -lib/petstore/models/additional_properties_string.rb lib/petstore/models/animal.rb lib/petstore/models/api_response.rb lib/petstore/models/array_of_array_of_number_only.rb lib/petstore/models/array_of_number_only.rb lib/petstore/models/array_test.rb -lib/petstore/models/big_cat.rb -lib/petstore/models/big_cat_all_of.rb lib/petstore/models/capitalization.rb lib/petstore/models/cat.rb lib/petstore/models/cat_all_of.rb @@ -99,28 +93,94 @@ lib/petstore/models/enum_class.rb lib/petstore/models/enum_test.rb lib/petstore/models/file.rb lib/petstore/models/file_schema_test_class.rb +lib/petstore/models/foo.rb lib/petstore/models/format_test.rb lib/petstore/models/has_only_read_only.rb +lib/petstore/models/health_check_result.rb +lib/petstore/models/inline_object.rb +lib/petstore/models/inline_object1.rb +lib/petstore/models/inline_object2.rb +lib/petstore/models/inline_object3.rb +lib/petstore/models/inline_object4.rb +lib/petstore/models/inline_object5.rb +lib/petstore/models/inline_response_default.rb lib/petstore/models/list.rb lib/petstore/models/map_test.rb lib/petstore/models/mixed_properties_and_additional_properties_class.rb lib/petstore/models/model200_response.rb lib/petstore/models/model_return.rb lib/petstore/models/name.rb +lib/petstore/models/nullable_class.rb lib/petstore/models/number_only.rb lib/petstore/models/order.rb lib/petstore/models/outer_composite.rb lib/petstore/models/outer_enum.rb +lib/petstore/models/outer_enum_default_value.rb +lib/petstore/models/outer_enum_integer.rb +lib/petstore/models/outer_enum_integer_default_value.rb lib/petstore/models/pet.rb lib/petstore/models/read_only_first.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb -lib/petstore/models/type_holder_default.rb -lib/petstore/models/type_holder_example.rb lib/petstore/models/user.rb -lib/petstore/models/xml_item.rb lib/petstore/version.rb petstore.gemspec +spec/api/another_fake_api_spec.rb +spec/api/default_api_spec.rb +spec/api/fake_api_spec.rb +spec/api/fake_classname_tags123_api_spec.rb +spec/api/pet_api_spec.rb +spec/api/store_api_spec.rb +spec/api/user_api_spec.rb spec/api_client_spec.rb spec/configuration_spec.rb +spec/models/additional_properties_class_spec.rb +spec/models/animal_spec.rb +spec/models/api_response_spec.rb +spec/models/array_of_array_of_number_only_spec.rb +spec/models/array_of_number_only_spec.rb +spec/models/array_test_spec.rb +spec/models/capitalization_spec.rb +spec/models/cat_all_of_spec.rb +spec/models/cat_spec.rb +spec/models/category_spec.rb +spec/models/class_model_spec.rb +spec/models/client_spec.rb +spec/models/dog_all_of_spec.rb +spec/models/dog_spec.rb +spec/models/enum_arrays_spec.rb +spec/models/enum_class_spec.rb +spec/models/enum_test_spec.rb +spec/models/file_schema_test_class_spec.rb +spec/models/file_spec.rb +spec/models/foo_spec.rb +spec/models/format_test_spec.rb +spec/models/has_only_read_only_spec.rb +spec/models/health_check_result_spec.rb +spec/models/inline_object1_spec.rb +spec/models/inline_object2_spec.rb +spec/models/inline_object3_spec.rb +spec/models/inline_object4_spec.rb +spec/models/inline_object5_spec.rb +spec/models/inline_object_spec.rb +spec/models/inline_response_default_spec.rb +spec/models/list_spec.rb +spec/models/map_test_spec.rb +spec/models/mixed_properties_and_additional_properties_class_spec.rb +spec/models/model200_response_spec.rb +spec/models/model_return_spec.rb +spec/models/name_spec.rb +spec/models/nullable_class_spec.rb +spec/models/number_only_spec.rb +spec/models/order_spec.rb +spec/models/outer_composite_spec.rb +spec/models/outer_enum_default_value_spec.rb +spec/models/outer_enum_integer_default_value_spec.rb +spec/models/outer_enum_integer_spec.rb +spec/models/outer_enum_spec.rb +spec/models/pet_spec.rb +spec/models/read_only_first_spec.rb +spec/models/special_model_name_spec.rb +spec/models/tag_spec.rb +spec/models/user_spec.rb spec/spec_helper.rb diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 8255487cce6f..719039e53116 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -57,11 +57,11 @@ Please follow the [installation](#installation) procedure and then run the follo require 'petstore' api_instance = Petstore::AnotherFakeApi.new -body = Petstore::Client.new # Client | client model +client = Petstore::Client.new # Client | client model begin #To test special tags - result = api_instance.call_123_test_special_tags(body) + result = api_instance.call_123_test_special_tags(client) p result rescue Petstore::ApiError => e puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" @@ -76,7 +76,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*Petstore::FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +*Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -84,7 +86,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *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_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_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -116,21 +118,12 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [Petstore::AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [Petstore::AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [Petstore::AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Petstore::AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [Petstore::AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [Petstore::AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [Petstore::AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Petstore::Animal](docs/Animal.md) - [Petstore::ApiResponse](docs/ApiResponse.md) - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Petstore::ArrayTest](docs/ArrayTest.md) - - [Petstore::BigCat](docs/BigCat.md) - - [Petstore::BigCatAllOf](docs/BigCatAllOf.md) - [Petstore::Capitalization](docs/Capitalization.md) - [Petstore::Cat](docs/Cat.md) - [Petstore::CatAllOf](docs/CatAllOf.md) @@ -144,26 +137,36 @@ Class | Method | HTTP request | Description - [Petstore::EnumTest](docs/EnumTest.md) - [Petstore::File](docs/File.md) - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Petstore::Foo](docs/Foo.md) - [Petstore::FormatTest](docs/FormatTest.md) - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) + - [Petstore::InlineObject](docs/InlineObject.md) + - [Petstore::InlineObject1](docs/InlineObject1.md) + - [Petstore::InlineObject2](docs/InlineObject2.md) + - [Petstore::InlineObject3](docs/InlineObject3.md) + - [Petstore::InlineObject4](docs/InlineObject4.md) + - [Petstore::InlineObject5](docs/InlineObject5.md) + - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) - [Petstore::List](docs/List.md) - [Petstore::MapTest](docs/MapTest.md) - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Petstore::Model200Response](docs/Model200Response.md) - [Petstore::ModelReturn](docs/ModelReturn.md) - [Petstore::Name](docs/Name.md) + - [Petstore::NullableClass](docs/NullableClass.md) - [Petstore::NumberOnly](docs/NumberOnly.md) - [Petstore::Order](docs/Order.md) - [Petstore::OuterComposite](docs/OuterComposite.md) - [Petstore::OuterEnum](docs/OuterEnum.md) + - [Petstore::OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [Petstore::OuterEnumInteger](docs/OuterEnumInteger.md) + - [Petstore::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - - [Petstore::TypeHolderDefault](docs/TypeHolderDefault.md) - - [Petstore::TypeHolderExample](docs/TypeHolderExample.md) - [Petstore::User](docs/User.md) - - [Petstore::XmlItem](docs/XmlItem.md) ## Documentation for Authorization @@ -183,10 +186,17 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key_query - **Location**: URL query string +### bearer_test + +- **Type**: Bearer authentication (JWT) + ### http_basic_test - **Type**: HTTP basic authentication +### http_signature_test + + ### petstore_auth diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index d61613cab354..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesAnyType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesAnyType.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesArray.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 27b9024ef27e..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesArray - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesArray.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index 8e64a21f91ed..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesBoolean - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesBoolean.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md index 353033010b29..e0d6811081cd 100644 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md @@ -4,34 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_string** | **Hash<String, String>** | | [optional] -**map_number** | **Hash<String, Float>** | | [optional] -**map_integer** | **Hash<String, Integer>** | | [optional] -**map_boolean** | **Hash<String, Boolean>** | | [optional] -**map_array_integer** | **Hash<String, Array<Integer>>** | | [optional] -**map_array_anytype** | **Hash<String, Array<Object>>** | | [optional] -**map_map_string** | **Hash<String, Hash<String, String>>** | | [optional] -**map_map_anytype** | **Hash<String, Hash<String, Object>>** | | [optional] -**anytype_1** | **Object** | | [optional] -**anytype_2** | **Object** | | [optional] -**anytype_3** | **Object** | | [optional] +**map_property** | **Hash<String, String>** | | [optional] +**map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional] ## Code Sample ```ruby require 'Petstore' -instance = Petstore::AdditionalPropertiesClass.new(map_string: null, - map_number: null, - map_integer: null, - map_boolean: null, - map_array_integer: null, - map_array_anytype: null, - map_map_string: null, - map_map_anytype: null, - anytype_1: null, - anytype_2: null, - anytype_3: null) +instance = Petstore::AdditionalPropertiesClass.new(map_property: null, + map_of_map_property: null) ``` diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 2e198d2814a1..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesInteger - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesInteger.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 419cec4a56d3..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesNumber - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesNumber.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesObject.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesObject.md deleted file mode 100644 index bd6525eac26a..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesObject.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesString.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesString.md deleted file mode 100644 index e6941073f289..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesString - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesString.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md index 71a7a54d9912..d7b52283ea50 100644 --- a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## call_123_test_special_tags -> Client call_123_test_special_tags(body) +> Client call_123_test_special_tags(client) To test special tags @@ -23,11 +23,11 @@ To test special tags and operation ID starting with number require 'petstore' api_instance = Petstore::AnotherFakeApi.new -body = Petstore::Client.new # Client | client model +client = Petstore::Client.new # Client | client model begin #To test special tags - result = api_instance.call_123_test_special_tags(body) + result = api_instance.call_123_test_special_tags(client) p result rescue Petstore::ApiError => e puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" @@ -39,7 +39,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/ruby-faraday/docs/BigCat.md b/samples/client/petstore/ruby-faraday/docs/BigCat.md deleted file mode 100644 index 7c48311d4223..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/BigCat.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::BigCat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::BigCat.new(kind: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/BigCatAllOf.md b/samples/client/petstore/ruby-faraday/docs/BigCatAllOf.md deleted file mode 100644 index 101cad0da23b..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/BigCatAllOf.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::BigCatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::BigCatAllOf.new(kind: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/DefaultApi.md b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/DefaultApi.md rename to samples/client/petstore/ruby-faraday/docs/DefaultApi.md diff --git a/samples/client/petstore/ruby-faraday/docs/EnumTest.md b/samples/client/petstore/ruby-faraday/docs/EnumTest.md index 41059ae76e63..e43f07205363 100644 --- a/samples/client/petstore/ruby-faraday/docs/EnumTest.md +++ b/samples/client/petstore/ruby-faraday/docs/EnumTest.md @@ -9,6 +9,9 @@ Name | Type | Description | Notes **enum_integer** | **Integer** | | [optional] **enum_number** | **Float** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] ## Code Sample @@ -19,7 +22,10 @@ instance = Petstore::EnumTest.new(enum_string: null, enum_string_required: null, enum_integer: null, enum_number: null, - outer_enum: null) + outer_enum: null, + outer_enum_integer: null, + outer_enum_default_value: null, + outer_enum_integer_default_value: null) ``` diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index 43b7961e5be4..4552514bc792 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -4,7 +4,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -12,7 +13,7 @@ Method | HTTP request | Description [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**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_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_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -21,28 +22,74 @@ Method | HTTP request | Description -## create_xml_item +## fake_health_get -> create_xml_item(xml_item) +> HealthCheckResult fake_health_get -creates an XmlItem +Health check endpoint -this route creates an XmlItem +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +begin + #Health check endpoint + result = api_instance.fake_health_get + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_health_get: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## fake_http_signature_test + +> fake_http_signature_test(pet, opts) + +test http signature authentication ### Example ```ruby # load the gem require 'petstore' +# setup authorization +Petstore.configure do |config| +end api_instance = Petstore::FakeApi.new -xml_item = Petstore::XmlItem.new # XmlItem | XmlItem Body +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +opts = { + query_1: 'query_1_example', # String | query parameter + header_1: 'header_1_example' # String | header parameter +} begin - #creates an XmlItem - api_instance.create_xml_item(xml_item) + #test http signature authentication + api_instance.fake_http_signature_test(pet, opts) rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->create_xml_item: #{e}" + puts "Exception when calling FakeApi->fake_http_signature_test: #{e}" end ``` @@ -51,7 +98,9 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query_1** | **String**| query parameter | [optional] + **header_1** | **String**| header parameter | [optional] ### Return type @@ -59,11 +108,11 @@ nil (empty response body) ### Authorization -No authorization required +[http_signature_test](../README.md#http_signature_test) ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 +- **Content-Type**: application/json, application/xml - **Accept**: Not defined @@ -111,7 +160,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* @@ -131,7 +180,7 @@ require 'petstore' api_instance = Petstore::FakeApi.new opts = { - body: Petstore::OuterComposite.new # OuterComposite | Input composite as post body + outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body } begin @@ -147,7 +196,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -159,7 +208,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* @@ -207,7 +256,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* @@ -255,13 +304,13 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* ## test_body_with_file_schema -> test_body_with_file_schema(body) +> test_body_with_file_schema(file_schema_test_class) @@ -274,10 +323,10 @@ For this test, the body for this request much reference a schema named `File`. require 'petstore' api_instance = Petstore::FakeApi.new -body = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | +file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | begin - api_instance.test_body_with_file_schema(body) + api_instance.test_body_with_file_schema(file_schema_test_class) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}" end @@ -288,7 +337,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -306,7 +355,7 @@ No authorization required ## test_body_with_query_params -> test_body_with_query_params(query, body) +> test_body_with_query_params(query, user) @@ -318,10 +367,10 @@ require 'petstore' api_instance = Petstore::FakeApi.new query = 'query_example' # String | -body = Petstore::User.new # User | +user = Petstore::User.new # User | begin - api_instance.test_body_with_query_params(query, body) + api_instance.test_body_with_query_params(query, user) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_body_with_query_params: #{e}" end @@ -333,7 +382,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **String**| | - **body** | [**User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -351,7 +400,7 @@ No authorization required ## test_client_model -> Client test_client_model(body) +> Client test_client_model(client) To test \"client\" model @@ -364,11 +413,11 @@ To test \"client\" model require 'petstore' api_instance = Petstore::FakeApi.new -body = Petstore::Client.new # Client | client model +client = Petstore::Client.new # Client | client model begin #To test \"client\" model - result = api_instance.test_client_model(body) + result = api_instance.test_client_model(client) p result rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_client_model: #{e}" @@ -380,7 +429,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -400,9 +449,9 @@ No authorization required > test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example @@ -435,7 +484,7 @@ opts = { } begin - #Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + #Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_endpoint_parameters: #{e}" @@ -551,6 +600,11 @@ Fake endpoint to test group parameters (optional) ```ruby # load the gem require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure Bearer authorization (JWT): bearer_test + config.access_token = 'YOUR_BEARER_TOKEN' +end api_instance = Petstore::FakeApi.new required_string_group = 56 # Integer | Required String in group parameters @@ -588,7 +642,7 @@ nil (empty response body) ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers @@ -598,7 +652,7 @@ No authorization required ## test_inline_additional_properties -> test_inline_additional_properties(param) +> test_inline_additional_properties(request_body) test inline additionalProperties @@ -609,11 +663,11 @@ test inline additionalProperties require 'petstore' api_instance = Petstore::FakeApi.new -param = {'key' => 'param_example'} # Hash | request body +request_body = {'key' => 'request_body_example'} # Hash | request body begin #test inline additionalProperties - api_instance.test_inline_additional_properties(param) + api_instance.test_inline_additional_properties(request_body) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" end @@ -624,7 +678,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**Hash<String, String>**](String.md)| request body | + **request_body** | [**Hash<String, String>**](String.md)| request body | ### Return type diff --git a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md index 97f8ea959a7c..4ccb9083cbae 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_classname -> Client test_classname(body) +> Client test_classname(client) To test class name in snake case @@ -30,11 +30,11 @@ Petstore.configure do |config| end api_instance = Petstore::FakeClassnameTags123Api.new -body = Petstore::Client.new # Client | client model +client = Petstore::Client.new # Client | client model begin #To test class name in snake case - result = api_instance.test_classname(body) + result = api_instance.test_classname(client) p result rescue Petstore::ApiError => e puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}" @@ -46,7 +46,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Foo.md b/samples/client/petstore/ruby-faraday/docs/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/Foo.md rename to samples/client/petstore/ruby-faraday/docs/Foo.md diff --git a/samples/client/petstore/ruby-faraday/docs/FormatTest.md b/samples/client/petstore/ruby-faraday/docs/FormatTest.md index 6c1ba0be6318..ca468a3d6506 100644 --- a/samples/client/petstore/ruby-faraday/docs/FormatTest.md +++ b/samples/client/petstore/ruby-faraday/docs/FormatTest.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **date_time** | **DateTime** | | [optional] **uuid** | **String** | | [optional] **password** | **String** | | -**big_decimal** | [**BigDecimal**](BigDecimal.md) | | [optional] +**pattern_with_digits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] ## Code Sample @@ -37,7 +38,8 @@ instance = Petstore::FormatTest.new(integer: null, date_time: null, uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84, password: null, - big_decimal: null) + pattern_with_digits: null, + pattern_with_digits_and_delimiter: null) ``` diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/HealthCheckResult.md b/samples/client/petstore/ruby-faraday/docs/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/HealthCheckResult.md rename to samples/client/petstore/ruby-faraday/docs/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject.md b/samples/client/petstore/ruby-faraday/docs/InlineObject.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject.md rename to samples/client/petstore/ruby-faraday/docs/InlineObject.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject1.md b/samples/client/petstore/ruby-faraday/docs/InlineObject1.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject1.md rename to samples/client/petstore/ruby-faraday/docs/InlineObject1.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject2.md b/samples/client/petstore/ruby-faraday/docs/InlineObject2.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject2.md rename to samples/client/petstore/ruby-faraday/docs/InlineObject2.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject3.md b/samples/client/petstore/ruby-faraday/docs/InlineObject3.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject3.md rename to samples/client/petstore/ruby-faraday/docs/InlineObject3.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject4.md b/samples/client/petstore/ruby-faraday/docs/InlineObject4.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject4.md rename to samples/client/petstore/ruby-faraday/docs/InlineObject4.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject5.md b/samples/client/petstore/ruby-faraday/docs/InlineObject5.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject5.md rename to samples/client/petstore/ruby-faraday/docs/InlineObject5.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineResponseDefault.md b/samples/client/petstore/ruby-faraday/docs/InlineResponseDefault.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/InlineResponseDefault.md rename to samples/client/petstore/ruby-faraday/docs/InlineResponseDefault.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/NullableClass.md b/samples/client/petstore/ruby-faraday/docs/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/NullableClass.md rename to samples/client/petstore/ruby-faraday/docs/NullableClass.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumDefaultValue.md b/samples/client/petstore/ruby-faraday/docs/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumDefaultValue.md rename to samples/client/petstore/ruby-faraday/docs/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumInteger.md b/samples/client/petstore/ruby-faraday/docs/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumInteger.md rename to samples/client/petstore/ruby-faraday/docs/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/ruby-faraday/docs/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumIntegerDefaultValue.md rename to samples/client/petstore/ruby-faraday/docs/OuterEnumIntegerDefaultValue.md diff --git a/samples/client/petstore/ruby-faraday/docs/PetApi.md b/samples/client/petstore/ruby-faraday/docs/PetApi.md index aa85e3e5bd24..6e650f534b1b 100644 --- a/samples/client/petstore/ruby-faraday/docs/PetApi.md +++ b/samples/client/petstore/ruby-faraday/docs/PetApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description ## add_pet -> add_pet(body) +> add_pet(pet) Add a new pet to the store @@ -34,11 +34,11 @@ Petstore.configure do |config| end api_instance = Petstore::PetApi.new -body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store begin #Add a new pet to the store - api_instance.add_pet(body) + api_instance.add_pet(pet) rescue Petstore::ApiError => e puts "Exception when calling PetApi->add_pet: #{e}" end @@ -49,7 +49,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -278,7 +278,7 @@ Name | Type | Description | Notes ## update_pet -> update_pet(body) +> update_pet(pet) Update an existing pet @@ -294,11 +294,11 @@ Petstore.configure do |config| end api_instance = Petstore::PetApi.new -body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store begin #Update an existing pet - api_instance.update_pet(body) + api_instance.update_pet(pet) rescue Petstore::ApiError => e puts "Exception when calling PetApi->update_pet: #{e}" end @@ -309,7 +309,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/client/petstore/ruby-faraday/docs/StoreApi.md index 83cb89664a6b..ffbc1d04b1ef 100644 --- a/samples/client/petstore/ruby-faraday/docs/StoreApi.md +++ b/samples/client/petstore/ruby-faraday/docs/StoreApi.md @@ -156,7 +156,7 @@ No authorization required ## place_order -> Order place_order(body) +> Order place_order(order) Place an order for a pet @@ -167,11 +167,11 @@ Place an order for a pet require 'petstore' api_instance = Petstore::StoreApi.new -body = Petstore::Order.new # Order | order placed for purchasing the pet +order = Petstore::Order.new # Order | order placed for purchasing the pet begin #Place an order for a pet - result = api_instance.place_order(body) + result = api_instance.place_order(order) p result rescue Petstore::ApiError => e puts "Exception when calling StoreApi->place_order: #{e}" @@ -183,7 +183,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -195,6 +195,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/ruby-faraday/docs/TypeHolderDefault.md b/samples/client/petstore/ruby-faraday/docs/TypeHolderDefault.md deleted file mode 100644 index 5abe52ff5c5a..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/TypeHolderDefault.md +++ /dev/null @@ -1,25 +0,0 @@ -# Petstore::TypeHolderDefault - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **String** | | [default to 'what'] -**number_item** | **Float** | | -**integer_item** | **Integer** | | -**bool_item** | **Boolean** | | [default to true] -**array_item** | **Array<Integer>** | | - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::TypeHolderDefault.new(string_item: null, - number_item: null, - integer_item: null, - bool_item: null, - array_item: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md b/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md deleted file mode 100644 index 2cab99f9bb7f..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md +++ /dev/null @@ -1,27 +0,0 @@ -# Petstore::TypeHolderExample - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **String** | | -**number_item** | **Float** | | -**float_item** | **Float** | | -**integer_item** | **Integer** | | -**bool_item** | **Boolean** | | -**array_item** | **Array<Integer>** | | - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::TypeHolderExample.new(string_item: what, - number_item: 1.234, - float_item: 1.234, - integer_item: -2, - bool_item: true, - array_item: [0, 1, 2, 3]) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/UserApi.md b/samples/client/petstore/ruby-faraday/docs/UserApi.md index 49a57ef58496..631a65ef1f19 100644 --- a/samples/client/petstore/ruby-faraday/docs/UserApi.md +++ b/samples/client/petstore/ruby-faraday/docs/UserApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## create_user -> create_user(body) +> create_user(user) Create user @@ -30,11 +30,11 @@ This can only be done by the logged in user. require 'petstore' api_instance = Petstore::UserApi.new -body = Petstore::User.new # User | Created user object +user = Petstore::User.new # User | Created user object begin #Create user - api_instance.create_user(body) + api_instance.create_user(user) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_user: #{e}" end @@ -45,7 +45,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -57,13 +57,13 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined ## create_users_with_array_input -> create_users_with_array_input(body) +> create_users_with_array_input(user) Creates list of users with given input array @@ -74,11 +74,11 @@ Creates list of users with given input array require 'petstore' api_instance = Petstore::UserApi.new -body = [Petstore::User.new] # Array | List of user object +user = [Petstore::User.new] # Array | List of user object begin #Creates list of users with given input array - api_instance.create_users_with_array_input(body) + api_instance.create_users_with_array_input(user) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_users_with_array_input: #{e}" end @@ -89,7 +89,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Array<User>**](User.md)| List of user object | + **user** | [**Array<User>**](User.md)| List of user object | ### Return type @@ -101,13 +101,13 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined ## create_users_with_list_input -> create_users_with_list_input(body) +> create_users_with_list_input(user) Creates list of users with given input array @@ -118,11 +118,11 @@ Creates list of users with given input array require 'petstore' api_instance = Petstore::UserApi.new -body = [Petstore::User.new] # Array | List of user object +user = [Petstore::User.new] # Array | List of user object begin #Creates list of users with given input array - api_instance.create_users_with_list_input(body) + api_instance.create_users_with_list_input(user) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_users_with_list_input: #{e}" end @@ -133,7 +133,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Array<User>**](User.md)| List of user object | + **user** | [**Array<User>**](User.md)| List of user object | ### Return type @@ -145,7 +145,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined @@ -329,7 +329,7 @@ No authorization required ## update_user -> update_user(username, body) +> update_user(username, user) Updated user @@ -343,11 +343,11 @@ require 'petstore' api_instance = Petstore::UserApi.new username = 'username_example' # String | name that need to be deleted -body = Petstore::User.new # User | Updated user object +user = Petstore::User.new # User | Updated user object begin #Updated user - api_instance.update_user(username, body) + api_instance.update_user(username, user) rescue Petstore::ApiError => e puts "Exception when calling UserApi->update_user: #{e}" end @@ -359,7 +359,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -371,6 +371,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/ruby-faraday/docs/XmlItem.md b/samples/client/petstore/ruby-faraday/docs/XmlItem.md deleted file mode 100644 index 5520ae0c2bcd..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/XmlItem.md +++ /dev/null @@ -1,73 +0,0 @@ -# Petstore::XmlItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attribute_string** | **String** | | [optional] -**attribute_number** | **Float** | | [optional] -**attribute_integer** | **Integer** | | [optional] -**attribute_boolean** | **Boolean** | | [optional] -**wrapped_array** | **Array<Integer>** | | [optional] -**name_string** | **String** | | [optional] -**name_number** | **Float** | | [optional] -**name_integer** | **Integer** | | [optional] -**name_boolean** | **Boolean** | | [optional] -**name_array** | **Array<Integer>** | | [optional] -**name_wrapped_array** | **Array<Integer>** | | [optional] -**prefix_string** | **String** | | [optional] -**prefix_number** | **Float** | | [optional] -**prefix_integer** | **Integer** | | [optional] -**prefix_boolean** | **Boolean** | | [optional] -**prefix_array** | **Array<Integer>** | | [optional] -**prefix_wrapped_array** | **Array<Integer>** | | [optional] -**namespace_string** | **String** | | [optional] -**namespace_number** | **Float** | | [optional] -**namespace_integer** | **Integer** | | [optional] -**namespace_boolean** | **Boolean** | | [optional] -**namespace_array** | **Array<Integer>** | | [optional] -**namespace_wrapped_array** | **Array<Integer>** | | [optional] -**prefix_ns_string** | **String** | | [optional] -**prefix_ns_number** | **Float** | | [optional] -**prefix_ns_integer** | **Integer** | | [optional] -**prefix_ns_boolean** | **Boolean** | | [optional] -**prefix_ns_array** | **Array<Integer>** | | [optional] -**prefix_ns_wrapped_array** | **Array<Integer>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::XmlItem.new(attribute_string: string, - attribute_number: 1.234, - attribute_integer: -2, - attribute_boolean: true, - wrapped_array: null, - name_string: string, - name_number: 1.234, - name_integer: -2, - name_boolean: true, - name_array: null, - name_wrapped_array: null, - prefix_string: string, - prefix_number: 1.234, - prefix_integer: -2, - prefix_boolean: true, - prefix_array: null, - prefix_wrapped_array: null, - namespace_string: string, - namespace_number: 1.234, - namespace_integer: -2, - namespace_boolean: true, - namespace_array: null, - namespace_wrapped_array: null, - prefix_ns_string: string, - prefix_ns_number: 1.234, - prefix_ns_integer: -2, - prefix_ns_boolean: true, - prefix_ns_array: null, - prefix_ns_wrapped_array: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/hello.txt b/samples/client/petstore/ruby-faraday/hello.txt similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/hello.txt rename to samples/client/petstore/ruby-faraday/hello.txt diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index d02eecd4d328..7f8ae56e123b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -17,21 +17,12 @@ require 'petstore/configuration' # Models -require 'petstore/models/additional_properties_any_type' -require 'petstore/models/additional_properties_array' -require 'petstore/models/additional_properties_boolean' require 'petstore/models/additional_properties_class' -require 'petstore/models/additional_properties_integer' -require 'petstore/models/additional_properties_number' -require 'petstore/models/additional_properties_object' -require 'petstore/models/additional_properties_string' require 'petstore/models/animal' require 'petstore/models/api_response' require 'petstore/models/array_of_array_of_number_only' require 'petstore/models/array_of_number_only' require 'petstore/models/array_test' -require 'petstore/models/big_cat' -require 'petstore/models/big_cat_all_of' require 'petstore/models/capitalization' require 'petstore/models/cat' require 'petstore/models/cat_all_of' @@ -45,29 +36,40 @@ require 'petstore/models/enum_test' require 'petstore/models/file' require 'petstore/models/file_schema_test_class' +require 'petstore/models/foo' require 'petstore/models/format_test' require 'petstore/models/has_only_read_only' +require 'petstore/models/health_check_result' +require 'petstore/models/inline_object' +require 'petstore/models/inline_object1' +require 'petstore/models/inline_object2' +require 'petstore/models/inline_object3' +require 'petstore/models/inline_object4' +require 'petstore/models/inline_object5' +require 'petstore/models/inline_response_default' require 'petstore/models/list' require 'petstore/models/map_test' require 'petstore/models/mixed_properties_and_additional_properties_class' require 'petstore/models/model200_response' require 'petstore/models/model_return' require 'petstore/models/name' +require 'petstore/models/nullable_class' require 'petstore/models/number_only' require 'petstore/models/order' require 'petstore/models/outer_composite' require 'petstore/models/outer_enum' +require 'petstore/models/outer_enum_default_value' +require 'petstore/models/outer_enum_integer' +require 'petstore/models/outer_enum_integer_default_value' require 'petstore/models/pet' require 'petstore/models/read_only_first' require 'petstore/models/special_model_name' require 'petstore/models/tag' -require 'petstore/models/type_holder_default' -require 'petstore/models/type_holder_example' require 'petstore/models/user' -require 'petstore/models/xml_item' # APIs require 'petstore/api/another_fake_api' +require 'petstore/api/default_api' require 'petstore/api/fake_api' require 'petstore/api/fake_classname_tags123_api' require 'petstore/api/pet_api' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index bf8e6ebded57..dfa6972327d2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -21,26 +21,26 @@ def initialize(api_client = ApiClient.default) end # To test special tags # To test special tags and operation ID starting with number - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def call_123_test_special_tags(body, opts = {}) - data, _status_code, _headers = call_123_test_special_tags_with_http_info(body, opts) + def call_123_test_special_tags(client, opts = {}) + data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts) data end # To test special tags # To test special tags and operation ID starting with number - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def call_123_test_special_tags_with_http_info(body, opts = {}) + def call_123_test_special_tags_with_http_info(client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AnotherFakeApi.call_123_test_special_tags" + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags" end # resource path local_var_path = '/another-fake/dummy' @@ -59,7 +59,7 @@ def call_123_test_special_tags_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(client) # return_type return_type = opts[:return_type] || 'Client' diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index ef91003dc4e8..3117e4bca528 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -19,51 +19,109 @@ class FakeApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # creates an XmlItem - # this route creates an XmlItem - # @param xml_item [XmlItem] XmlItem Body + # Health check endpoint # @param [Hash] opts the optional parameters + # @return [HealthCheckResult] + def fake_health_get(opts = {}) + data, _status_code, _headers = fake_health_get_with_http_info(opts) + data + end + + # Health check endpoint + # @param [Hash] opts the optional parameters + # @return [Array<(HealthCheckResult, Integer, Hash)>] HealthCheckResult data, response status code and response headers + def fake_health_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_health_get ...' + end + # resource path + local_var_path = '/fake/health' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HealthCheckResult' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # test http signature authentication + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter # @return [nil] - def create_xml_item(xml_item, opts = {}) - create_xml_item_with_http_info(xml_item, opts) + def fake_http_signature_test(pet, opts = {}) + fake_http_signature_test_with_http_info(pet, opts) nil end - # creates an XmlItem - # this route creates an XmlItem - # @param xml_item [XmlItem] XmlItem Body + # test http signature authentication + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_xml_item_with_http_info(xml_item, opts = {}) + def fake_http_signature_test_with_http_info(pet, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.create_xml_item ...' + @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' end - # verify the required parameter 'xml_item' is set - if @api_client.config.client_side_validation && xml_item.nil? - fail ArgumentError, "Missing the required parameter 'xml_item' when calling FakeApi.create_xml_item" + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" end # resource path - local_var_path = '/fake/create_xml_item' + local_var_path = '/fake/http-signature-test' # query parameters query_params = opts[:query_params] || {} + query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) + header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(xml_item) + post_body = opts[:body] || @api_client.object_to_http_body(pet) # return_type return_type = opts[:return_type] # auth_names - auth_names = opts[:auth_names] || [] + auth_names = opts[:auth_names] || ['http_signature_test'] new_options = opts.merge( :header_params => header_params, @@ -74,9 +132,9 @@ def create_xml_item_with_http_info(xml_item, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#create_xml_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -108,6 +166,8 @@ def fake_outer_boolean_serialize_with_http_info(opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -139,7 +199,7 @@ def fake_outer_boolean_serialize_with_http_info(opts = {}) # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :body Input composite as post body + # @option opts [OuterComposite] :outer_composite Input composite as post body # @return [OuterComposite] def fake_outer_composite_serialize(opts = {}) data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) @@ -148,7 +208,7 @@ def fake_outer_composite_serialize(opts = {}) # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :body Input composite as post body + # @option opts [OuterComposite] :outer_composite Input composite as post body # @return [Array<(OuterComposite, Integer, Hash)>] OuterComposite data, response status code and response headers def fake_outer_composite_serialize_with_http_info(opts = {}) if @api_client.config.debugging @@ -164,12 +224,14 @@ def fake_outer_composite_serialize_with_http_info(opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'outer_composite']) # return_type return_type = opts[:return_type] || 'OuterComposite' @@ -220,6 +282,8 @@ def fake_outer_number_serialize_with_http_info(opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -276,6 +340,8 @@ def fake_outer_string_serialize_with_http_info(opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -306,25 +372,25 @@ def fake_outer_string_serialize_with_http_info(opts = {}) end # For this test, the body for this request much reference a schema named `File`. - # @param body [FileSchemaTestClass] + # @param file_schema_test_class [FileSchemaTestClass] # @param [Hash] opts the optional parameters # @return [nil] - def test_body_with_file_schema(body, opts = {}) - test_body_with_file_schema_with_http_info(body, opts) + def test_body_with_file_schema(file_schema_test_class, opts = {}) + test_body_with_file_schema_with_http_info(file_schema_test_class, opts) nil end # For this test, the body for this request much reference a schema named `File`. - # @param body [FileSchemaTestClass] + # @param file_schema_test_class [FileSchemaTestClass] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_body_with_file_schema_with_http_info(body, opts = {}) + def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_body_with_file_schema" + # verify the required parameter 'file_schema_test_class' is set + if @api_client.config.client_side_validation && file_schema_test_class.nil? + fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema" end # resource path local_var_path = '/fake/body-with-file-schema' @@ -341,7 +407,7 @@ def test_body_with_file_schema_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(file_schema_test_class) # return_type return_type = opts[:return_type] @@ -366,19 +432,19 @@ def test_body_with_file_schema_with_http_info(body, opts = {}) end # @param query [String] - # @param body [User] + # @param user [User] # @param [Hash] opts the optional parameters # @return [nil] - def test_body_with_query_params(query, body, opts = {}) - test_body_with_query_params_with_http_info(query, body, opts) + def test_body_with_query_params(query, user, opts = {}) + test_body_with_query_params_with_http_info(query, user, opts) nil end # @param query [String] - # @param body [User] + # @param user [User] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_body_with_query_params_with_http_info(query, body, opts = {}) + def test_body_with_query_params_with_http_info(query, user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...' end @@ -386,9 +452,9 @@ def test_body_with_query_params_with_http_info(query, body, opts = {}) if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params" end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_body_with_query_params" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params" end # resource path local_var_path = '/fake/body-with-query-params' @@ -406,7 +472,7 @@ def test_body_with_query_params_with_http_info(query, body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] @@ -432,26 +498,26 @@ def test_body_with_query_params_with_http_info(query, body, opts = {}) # To test \"client\" model # To test \"client\" model - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def test_client_model(body, opts = {}) - data, _status_code, _headers = test_client_model_with_http_info(body, opts) + def test_client_model(client, opts = {}) + data, _status_code, _headers = test_client_model_with_http_info(client, opts) data end # To test \"client\" model # To test \"client\" model - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def test_client_model_with_http_info(body, opts = {}) + def test_client_model_with_http_info(client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_client_model" + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model" end # resource path local_var_path = '/fake' @@ -470,7 +536,7 @@ def test_client_model_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(client) # return_type return_type = opts[:return_type] || 'Client' @@ -494,8 +560,8 @@ def test_client_model_with_http_info(body, opts = {}) return data, status_code, headers end - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # @param number [Float] None # @param double [Float] None # @param pattern_without_delimiter [String] None @@ -517,8 +583,8 @@ def test_endpoint_parameters(number, double, pattern_without_delimiter, byte, op nil end - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # @param number [Float] None # @param double [Float] None # @param pattern_without_delimiter [String] None @@ -732,7 +798,7 @@ def test_enum_parameters_with_http_info(opts = {}) # query parameters query_params = opts[:query_params] || {} - query_params[:'enum_query_string_array'] = @api_client.build_collection_param(opts[:'enum_query_string_array'], :csv) if !opts[:'enum_query_string_array'].nil? + query_params[:'enum_query_string_array'] = @api_client.build_collection_param(opts[:'enum_query_string_array'], :multi) if !opts[:'enum_query_string_array'].nil? query_params[:'enum_query_string'] = opts[:'enum_query_string'] if !opts[:'enum_query_string'].nil? query_params[:'enum_query_integer'] = opts[:'enum_query_integer'] if !opts[:'enum_query_integer'].nil? query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil? @@ -840,7 +906,7 @@ def test_group_parameters_with_http_info(required_string_group, required_boolean return_type = opts[:return_type] # auth_names - auth_names = opts[:auth_names] || [] + auth_names = opts[:auth_names] || ['bearer_test'] new_options = opts.merge( :header_params => header_params, @@ -859,25 +925,25 @@ def test_group_parameters_with_http_info(required_string_group, required_boolean end # test inline additionalProperties - # @param param [Hash] request body + # @param request_body [Hash] request body # @param [Hash] opts the optional parameters # @return [nil] - def test_inline_additional_properties(param, opts = {}) - test_inline_additional_properties_with_http_info(param, opts) + def test_inline_additional_properties(request_body, opts = {}) + test_inline_additional_properties_with_http_info(request_body, opts) nil end # test inline additionalProperties - # @param param [Hash] request body + # @param request_body [Hash] request body # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_inline_additional_properties_with_http_info(param, opts = {}) + def test_inline_additional_properties_with_http_info(request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...' 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_inline_additional_properties" + # verify the required parameter 'request_body' is set + if @api_client.config.client_side_validation && request_body.nil? + fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties" end # resource path local_var_path = '/fake/inline-additionalProperties' @@ -894,7 +960,7 @@ def test_inline_additional_properties_with_http_info(param, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(param) + post_body = opts[:body] || @api_client.object_to_http_body(request_body) # return_type return_type = opts[:return_type] @@ -1036,7 +1102,7 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur # query parameters query_params = opts[:query_params] || {} - query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :multi) query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) query_params[:'http'] = @api_client.build_collection_param(http, :space) query_params[:'url'] = @api_client.build_collection_param(url, :csv) diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index b266f0977478..1e44496d5f82 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -21,26 +21,26 @@ def initialize(api_client = ApiClient.default) end # To test class name in snake case # To test class name in snake case - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def test_classname(body, opts = {}) - data, _status_code, _headers = test_classname_with_http_info(body, opts) + def test_classname(client, opts = {}) + data, _status_code, _headers = test_classname_with_http_info(client, opts) data end # To test class name in snake case # To test class name in snake case - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def test_classname_with_http_info(body, opts = {}) + def test_classname_with_http_info(client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FakeClassnameTags123Api.test_classname" + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname" end # resource path local_var_path = '/fake_classname_test' @@ -59,7 +59,7 @@ def test_classname_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(client) # return_type return_type = opts[:return_type] || 'Client' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 1f6c48a31cdc..849945bcd6ec 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -20,25 +20,25 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Add a new pet to the store - # @param body [Pet] Pet object that needs to be added to the store + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] - def add_pet(body, opts = {}) - add_pet_with_http_info(body, opts) + def add_pet(pet, opts = {}) + add_pet_with_http_info(pet, opts) nil end # Add a new pet to the store - # @param body [Pet] Pet object that needs to be added to the store + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def add_pet_with_http_info(body, opts = {}) + def add_pet_with_http_info(pet, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.add_pet" + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet" end # resource path local_var_path = '/pet' @@ -55,7 +55,7 @@ def add_pet_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(pet) # return_type return_type = opts[:return_type] @@ -103,7 +103,7 @@ def delete_pet_with_http_info(pet_id, opts = {}) fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -290,7 +290,7 @@ def get_pet_by_id_with_http_info(pet_id, opts = {}) fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -329,25 +329,25 @@ def get_pet_by_id_with_http_info(pet_id, opts = {}) end # Update an existing pet - # @param body [Pet] Pet object that needs to be added to the store + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] - def update_pet(body, opts = {}) - update_pet_with_http_info(body, opts) + def update_pet(pet, opts = {}) + update_pet_with_http_info(pet, opts) nil end # Update an existing pet - # @param body [Pet] Pet object that needs to be added to the store + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_pet_with_http_info(body, opts = {}) + def update_pet_with_http_info(pet, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.update_pet" + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet" end # resource path local_var_path = '/pet' @@ -364,7 +364,7 @@ def update_pet_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(pet) # return_type return_type = opts[:return_type] @@ -414,7 +414,7 @@ def update_pet_with_form_with_http_info(pet_id, opts = {}) fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -480,7 +480,7 @@ def upload_file_with_http_info(pet_id, opts = {}) fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" end # resource path - local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -552,7 +552,7 @@ def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" end # resource path - local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 5e510a6c7e04..dafc7a71696c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -43,7 +43,7 @@ def delete_order_with_http_info(order_id, opts = {}) fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" end # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -167,7 +167,7 @@ def get_order_by_id_with_http_info(order_id, opts = {}) end # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -206,25 +206,25 @@ def get_order_by_id_with_http_info(order_id, opts = {}) end # Place an order for a pet - # @param body [Order] order placed for purchasing the pet + # @param order [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] - def place_order(body, opts = {}) - data, _status_code, _headers = place_order_with_http_info(body, opts) + def place_order(order, opts = {}) + data, _status_code, _headers = place_order_with_http_info(order, opts) data end # Place an order for a pet - # @param body [Order] order placed for purchasing the pet + # @param order [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers - def place_order_with_http_info(body, opts = {}) + def place_order_with_http_info(order, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling StoreApi.place_order" + # verify the required parameter 'order' is set + if @api_client.config.client_side_validation && order.nil? + fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order" end # resource path local_var_path = '/store/order' @@ -236,12 +236,14 @@ def place_order_with_http_info(body, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(order) # return_type return_type = opts[:return_type] || 'Order' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 30d0aff9129c..8e2dd2a11a25 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -21,26 +21,26 @@ def initialize(api_client = ApiClient.default) end # Create user # This can only be done by the logged in user. - # @param body [User] Created user object + # @param user [User] Created user object # @param [Hash] opts the optional parameters # @return [nil] - def create_user(body, opts = {}) - create_user_with_http_info(body, opts) + def create_user(user, opts = {}) + create_user_with_http_info(user, opts) nil end # Create user # This can only be done by the logged in user. - # @param body [User] Created user object + # @param user [User] Created user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_user_with_http_info(body, opts = {}) + def create_user_with_http_info(user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_user ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_user" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user" end # resource path local_var_path = '/user' @@ -50,12 +50,14 @@ def create_user_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] @@ -80,25 +82,25 @@ def create_user_with_http_info(body, opts = {}) end # Creates list of users with given input array - # @param body [Array] List of user object + # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] - def create_users_with_array_input(body, opts = {}) - create_users_with_array_input_with_http_info(body, opts) + def create_users_with_array_input(user, opts = {}) + create_users_with_array_input_with_http_info(user, opts) nil end # Creates list of users with given input array - # @param body [Array] List of user object + # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_users_with_array_input_with_http_info(body, opts = {}) + def create_users_with_array_input_with_http_info(user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_array_input" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input" end # resource path local_var_path = '/user/createWithArray' @@ -108,12 +110,14 @@ def create_users_with_array_input_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] @@ -138,25 +142,25 @@ def create_users_with_array_input_with_http_info(body, opts = {}) end # Creates list of users with given input array - # @param body [Array] List of user object + # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] - def create_users_with_list_input(body, opts = {}) - create_users_with_list_input_with_http_info(body, opts) + def create_users_with_list_input(user, opts = {}) + create_users_with_list_input_with_http_info(user, opts) nil end # Creates list of users with given input array - # @param body [Array] List of user object + # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_users_with_list_input_with_http_info(body, opts = {}) + def create_users_with_list_input_with_http_info(user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_list_input" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input" end # resource path local_var_path = '/user/createWithList' @@ -166,12 +170,14 @@ def create_users_with_list_input_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] @@ -219,7 +225,7 @@ def delete_user_with_http_info(username, opts = {}) fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -277,7 +283,7 @@ def get_user_by_name_with_http_info(username, opts = {}) fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -438,21 +444,21 @@ def logout_user_with_http_info(opts = {}) # Updated user # This can only be done by the logged in user. # @param username [String] name that need to be deleted - # @param body [User] Updated user object + # @param user [User] Updated user object # @param [Hash] opts the optional parameters # @return [nil] - def update_user(username, body, opts = {}) - update_user_with_http_info(username, body, opts) + def update_user(username, user, opts = {}) + update_user_with_http_info(username, user, opts) nil end # Updated user # This can only be done by the logged in user. # @param username [String] name that need to be deleted - # @param body [User] Updated user object + # @param user [User] Updated user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_user_with_http_info(username, body, opts = {}) + def update_user_with_http_info(username, user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.update_user ...' end @@ -460,24 +466,26 @@ def update_user_with_http_info(username, body, opts = {}) if @api_client.config.client_side_validation && username.nil? fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user" end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.update_user" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 6d4679bf5277..a98fb5c45bd1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -202,6 +202,14 @@ def auth_settings key: 'api_key_query', value: api_key_with_prefix('api_key_query') }, + 'bearer_test' => + { + type: 'bearer', + in: 'header', + format: 'JWT', + key: 'Authorization', + value: "Bearer #{access_token}" + }, 'http_basic_test' => { type: 'basic', @@ -223,8 +231,41 @@ def auth_settings def server_settings [ { - url: "http://petstore.swagger.io:80/v2", - description: "No description provided", + url: "http://{server}.swagger.io:{port}/v2", + description: "petstore server", + variables: { + server: { + description: "No description provided", + default_value: "petstore", + enum_values: [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + port: { + description: "No description provided", + default_value: "80", + enum_values: [ + "80", + "8080" + ] + } + } + }, + { + url: "https://localhost:8080/{version}", + description: "The local server", + variables: { + version: { + description: "No description provided", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } } ] end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb deleted file mode 100644 index 9d69317eab1a..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesAnyType - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesAnyType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesAnyType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb deleted file mode 100644 index 75afda54eeed..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesArray - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesArray` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesArray`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb deleted file mode 100644 index 3087eae37aef..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesBoolean - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesBoolean` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesBoolean`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index ff8841189f78..2e353ef8e464 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -14,59 +14,23 @@ module Petstore class AdditionalPropertiesClass - attr_accessor :map_string + attr_accessor :map_property - attr_accessor :map_number - - attr_accessor :map_integer - - attr_accessor :map_boolean - - attr_accessor :map_array_integer - - attr_accessor :map_array_anytype - - attr_accessor :map_map_string - - attr_accessor :map_map_anytype - - attr_accessor :anytype_1 - - attr_accessor :anytype_2 - - attr_accessor :anytype_3 + attr_accessor :map_of_map_property # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'map_string' => :'map_string', - :'map_number' => :'map_number', - :'map_integer' => :'map_integer', - :'map_boolean' => :'map_boolean', - :'map_array_integer' => :'map_array_integer', - :'map_array_anytype' => :'map_array_anytype', - :'map_map_string' => :'map_map_string', - :'map_map_anytype' => :'map_map_anytype', - :'anytype_1' => :'anytype_1', - :'anytype_2' => :'anytype_2', - :'anytype_3' => :'anytype_3' + :'map_property' => :'map_property', + :'map_of_map_property' => :'map_of_map_property' } end # Attribute type mapping. def self.openapi_types { - :'map_string' => :'Hash', - :'map_number' => :'Hash', - :'map_integer' => :'Hash', - :'map_boolean' => :'Hash', - :'map_array_integer' => :'Hash>', - :'map_array_anytype' => :'Hash>', - :'map_map_string' => :'Hash>', - :'map_map_anytype' => :'Hash>', - :'anytype_1' => :'Object', - :'anytype_2' => :'Object', - :'anytype_3' => :'Object' + :'map_property' => :'Hash', + :'map_of_map_property' => :'Hash>' } end @@ -91,65 +55,17 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'map_string') - if (value = attributes[:'map_string']).is_a?(Hash) - self.map_string = value + if attributes.key?(:'map_property') + if (value = attributes[:'map_property']).is_a?(Hash) + self.map_property = value end end - if attributes.key?(:'map_number') - if (value = attributes[:'map_number']).is_a?(Hash) - self.map_number = value + if attributes.key?(:'map_of_map_property') + if (value = attributes[:'map_of_map_property']).is_a?(Hash) + self.map_of_map_property = value end end - - if attributes.key?(:'map_integer') - if (value = attributes[:'map_integer']).is_a?(Hash) - self.map_integer = value - end - end - - if attributes.key?(:'map_boolean') - if (value = attributes[:'map_boolean']).is_a?(Hash) - self.map_boolean = value - end - end - - if attributes.key?(:'map_array_integer') - if (value = attributes[:'map_array_integer']).is_a?(Hash) - self.map_array_integer = value - end - end - - if attributes.key?(:'map_array_anytype') - if (value = attributes[:'map_array_anytype']).is_a?(Hash) - self.map_array_anytype = value - end - end - - if attributes.key?(:'map_map_string') - if (value = attributes[:'map_map_string']).is_a?(Hash) - self.map_map_string = value - end - end - - if attributes.key?(:'map_map_anytype') - if (value = attributes[:'map_map_anytype']).is_a?(Hash) - self.map_map_anytype = value - end - end - - if attributes.key?(:'anytype_1') - self.anytype_1 = attributes[:'anytype_1'] - end - - if attributes.key?(:'anytype_2') - self.anytype_2 = attributes[:'anytype_2'] - end - - if attributes.key?(:'anytype_3') - self.anytype_3 = attributes[:'anytype_3'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -170,17 +86,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - map_string == o.map_string && - map_number == o.map_number && - map_integer == o.map_integer && - map_boolean == o.map_boolean && - map_array_integer == o.map_array_integer && - map_array_anytype == o.map_array_anytype && - map_map_string == o.map_map_string && - map_map_anytype == o.map_map_anytype && - anytype_1 == o.anytype_1 && - anytype_2 == o.anytype_2 && - anytype_3 == o.anytype_3 + map_property == o.map_property && + map_of_map_property == o.map_of_map_property end # @see the `==` method @@ -192,7 +99,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [map_string, map_number, map_integer, map_boolean, map_array_integer, map_array_anytype, map_map_string, map_map_anytype, anytype_1, anytype_2, anytype_3].hash + [map_property, map_of_map_property].hash end # Builds the object from hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb deleted file mode 100644 index 62d680fc49c0..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesInteger - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesInteger` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesInteger`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb deleted file mode 100644 index d218e5673a0b..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesNumber - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb deleted file mode 100644 index d0dc9d7e48d6..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesObject - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb deleted file mode 100644 index 22627845e37b..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesString - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesString` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesString`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat.rb deleted file mode 100644 index 9be82c414ced..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class BigCat < Cat - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'BigCatAllOf', - :'Cat' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCat` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true && super - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb deleted file mode 100644 index 36b824ea4520..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class BigCatAllOf - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCatAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index b1faea6d4a6f..473d7994ad6d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -24,6 +24,12 @@ class EnumTest attr_accessor :outer_enum + attr_accessor :outer_enum_integer + + attr_accessor :outer_enum_default_value + + attr_accessor :outer_enum_integer_default_value + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -53,7 +59,10 @@ def self.attribute_map :'enum_string_required' => :'enum_string_required', :'enum_integer' => :'enum_integer', :'enum_number' => :'enum_number', - :'outer_enum' => :'outerEnum' + :'outer_enum' => :'outerEnum', + :'outer_enum_integer' => :'outerEnumInteger', + :'outer_enum_default_value' => :'outerEnumDefaultValue', + :'outer_enum_integer_default_value' => :'outerEnumIntegerDefaultValue' } end @@ -64,13 +73,17 @@ def self.openapi_types :'enum_string_required' => :'String', :'enum_integer' => :'Integer', :'enum_number' => :'Float', - :'outer_enum' => :'OuterEnum' + :'outer_enum' => :'OuterEnum', + :'outer_enum_integer' => :'OuterEnumInteger', + :'outer_enum_default_value' => :'OuterEnumDefaultValue', + :'outer_enum_integer_default_value' => :'OuterEnumIntegerDefaultValue' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'outer_enum', ]) end @@ -108,6 +121,18 @@ def initialize(attributes = {}) if attributes.key?(:'outer_enum') self.outer_enum = attributes[:'outer_enum'] end + + if attributes.key?(:'outer_enum_integer') + self.outer_enum_integer = attributes[:'outer_enum_integer'] + end + + if attributes.key?(:'outer_enum_default_value') + self.outer_enum_default_value = attributes[:'outer_enum_default_value'] + end + + if attributes.key?(:'outer_enum_integer_default_value') + self.outer_enum_integer_default_value = attributes[:'outer_enum_integer_default_value'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -185,7 +210,10 @@ def ==(o) enum_string_required == o.enum_string_required && enum_integer == o.enum_integer && enum_number == o.enum_number && - outer_enum == o.outer_enum + outer_enum == o.outer_enum && + outer_enum_integer == o.outer_enum_integer && + outer_enum_default_value == o.outer_enum_default_value && + outer_enum_integer_default_value == o.outer_enum_integer_default_value end # @see the `==` method @@ -197,7 +225,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [enum_string, enum_string_required, enum_integer, enum_number, outer_enum].hash + [enum_string, enum_string_required, enum_integer, enum_number, outer_enum, outer_enum_integer, outer_enum_default_value, outer_enum_integer_default_value].hash end # Builds the object from hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 170955b07f30..d39e9c915806 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -40,7 +40,11 @@ class FormatTest attr_accessor :password - attr_accessor :big_decimal + # A string that is a 10 digit number. Can have leading zeros. + attr_accessor :pattern_with_digits + + # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + attr_accessor :pattern_with_digits_and_delimiter # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map @@ -58,7 +62,8 @@ def self.attribute_map :'date_time' => :'dateTime', :'uuid' => :'uuid', :'password' => :'password', - :'big_decimal' => :'BigDecimal' + :'pattern_with_digits' => :'pattern_with_digits', + :'pattern_with_digits_and_delimiter' => :'pattern_with_digits_and_delimiter' } end @@ -78,7 +83,8 @@ def self.openapi_types :'date_time' => :'DateTime', :'uuid' => :'String', :'password' => :'String', - :'big_decimal' => :'BigDecimal' + :'pattern_with_digits' => :'String', + :'pattern_with_digits_and_delimiter' => :'String' } end @@ -155,8 +161,12 @@ def initialize(attributes = {}) self.password = attributes[:'password'] end - if attributes.key?(:'big_decimal') - self.big_decimal = attributes[:'big_decimal'] + if attributes.key?(:'pattern_with_digits') + self.pattern_with_digits = attributes[:'pattern_with_digits'] + end + + if attributes.key?(:'pattern_with_digits_and_delimiter') + self.pattern_with_digits_and_delimiter = attributes[:'pattern_with_digits_and_delimiter'] end end @@ -217,11 +227,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "byte", byte cannot be nil.') end - pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) - if @byte !~ pattern - invalid_properties.push("invalid value for \"byte\", must conform to the pattern #{pattern}.") - end - if @date.nil? invalid_properties.push('invalid value for "date", date cannot be nil.') end @@ -238,6 +243,16 @@ def list_invalid_properties invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') end + pattern = Regexp.new(/^\d{10}$/) + if !@pattern_with_digits.nil? && @pattern_with_digits !~ pattern + invalid_properties.push("invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}.") + end + + pattern = Regexp.new(/^image_\d{1,3}$/i) + if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ pattern + invalid_properties.push("invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}.") + end + invalid_properties end @@ -257,11 +272,12 @@ def valid? return false if !@double.nil? && @double < 67.8 return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) return false if @byte.nil? - return false if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) return false if @date.nil? return false if @password.nil? return false if @password.to_s.length > 64 return false if @password.to_s.length < 10 + return false if !@pattern_with_digits.nil? && @pattern_with_digits !~ Regexp.new(/^\d{10}$/) + return false if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ Regexp.new(/^image_\d{1,3}$/i) true end @@ -350,21 +366,6 @@ def string=(string) @string = string end - # Custom attribute writer method with validation - # @param [Object] byte Value to be assigned - def byte=(byte) - if byte.nil? - fail ArgumentError, 'byte cannot be nil' - end - - pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) - if byte !~ pattern - fail ArgumentError, "invalid value for \"byte\", must conform to the pattern #{pattern}." - end - - @byte = byte - end - # Custom attribute writer method with validation # @param [Object] password Value to be assigned def password=(password) @@ -383,6 +384,28 @@ def password=(password) @password = password end + # Custom attribute writer method with validation + # @param [Object] pattern_with_digits Value to be assigned + def pattern_with_digits=(pattern_with_digits) + pattern = Regexp.new(/^\d{10}$/) + if !pattern_with_digits.nil? && pattern_with_digits !~ pattern + fail ArgumentError, "invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}." + end + + @pattern_with_digits = pattern_with_digits + end + + # Custom attribute writer method with validation + # @param [Object] pattern_with_digits_and_delimiter Value to be assigned + def pattern_with_digits_and_delimiter=(pattern_with_digits_and_delimiter) + pattern = Regexp.new(/^image_\d{1,3}$/i) + if !pattern_with_digits_and_delimiter.nil? && pattern_with_digits_and_delimiter !~ pattern + fail ArgumentError, "invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}." + end + + @pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -401,7 +424,8 @@ def ==(o) date_time == o.date_time && uuid == o.uuid && password == o.password && - big_decimal == o.big_decimal + pattern_with_digits == o.pattern_with_digits && + pattern_with_digits_and_delimiter == o.pattern_with_digits_and_delimiter end # @see the `==` method @@ -413,7 +437,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, big_decimal].hash + [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash end # Builds the object from hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb rename to samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb deleted file mode 100644 index 4a3e8428f95d..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class TypeHolderDefault - attr_accessor :string_item - - attr_accessor :number_item - - attr_accessor :integer_item - - attr_accessor :bool_item - - attr_accessor :array_item - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'string_item' => :'string_item', - :'number_item' => :'number_item', - :'integer_item' => :'integer_item', - :'bool_item' => :'bool_item', - :'array_item' => :'array_item' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'string_item' => :'String', - :'number_item' => :'Float', - :'integer_item' => :'Integer', - :'bool_item' => :'Boolean', - :'array_item' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::TypeHolderDefault` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TypeHolderDefault`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'string_item') - self.string_item = attributes[:'string_item'] - else - self.string_item = 'what' - end - - if attributes.key?(:'number_item') - self.number_item = attributes[:'number_item'] - end - - if attributes.key?(:'integer_item') - self.integer_item = attributes[:'integer_item'] - end - - if attributes.key?(:'bool_item') - self.bool_item = attributes[:'bool_item'] - else - self.bool_item = true - end - - if attributes.key?(:'array_item') - if (value = attributes[:'array_item']).is_a?(Array) - self.array_item = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @string_item.nil? - invalid_properties.push('invalid value for "string_item", string_item cannot be nil.') - end - - if @number_item.nil? - invalid_properties.push('invalid value for "number_item", number_item cannot be nil.') - end - - if @integer_item.nil? - invalid_properties.push('invalid value for "integer_item", integer_item cannot be nil.') - end - - if @bool_item.nil? - invalid_properties.push('invalid value for "bool_item", bool_item cannot be nil.') - end - - if @array_item.nil? - invalid_properties.push('invalid value for "array_item", array_item cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @string_item.nil? - return false if @number_item.nil? - return false if @integer_item.nil? - return false if @bool_item.nil? - return false if @array_item.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - string_item == o.string_item && - number_item == o.number_item && - integer_item == o.integer_item && - bool_item == o.bool_item && - array_item == o.array_item - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [string_item, number_item, integer_item, bool_item, array_item].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb deleted file mode 100644 index b3aac77c4528..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class TypeHolderExample - attr_accessor :string_item - - attr_accessor :number_item - - attr_accessor :float_item - - attr_accessor :integer_item - - attr_accessor :bool_item - - attr_accessor :array_item - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'string_item' => :'string_item', - :'number_item' => :'number_item', - :'float_item' => :'float_item', - :'integer_item' => :'integer_item', - :'bool_item' => :'bool_item', - :'array_item' => :'array_item' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'string_item' => :'String', - :'number_item' => :'Float', - :'float_item' => :'Float', - :'integer_item' => :'Integer', - :'bool_item' => :'Boolean', - :'array_item' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::TypeHolderExample` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TypeHolderExample`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'string_item') - self.string_item = attributes[:'string_item'] - end - - if attributes.key?(:'number_item') - self.number_item = attributes[:'number_item'] - end - - if attributes.key?(:'float_item') - self.float_item = attributes[:'float_item'] - end - - if attributes.key?(:'integer_item') - self.integer_item = attributes[:'integer_item'] - end - - if attributes.key?(:'bool_item') - self.bool_item = attributes[:'bool_item'] - end - - if attributes.key?(:'array_item') - if (value = attributes[:'array_item']).is_a?(Array) - self.array_item = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @string_item.nil? - invalid_properties.push('invalid value for "string_item", string_item cannot be nil.') - end - - if @number_item.nil? - invalid_properties.push('invalid value for "number_item", number_item cannot be nil.') - end - - if @float_item.nil? - invalid_properties.push('invalid value for "float_item", float_item cannot be nil.') - end - - if @integer_item.nil? - invalid_properties.push('invalid value for "integer_item", integer_item cannot be nil.') - end - - if @bool_item.nil? - invalid_properties.push('invalid value for "bool_item", bool_item cannot be nil.') - end - - if @array_item.nil? - invalid_properties.push('invalid value for "array_item", array_item cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @string_item.nil? - return false if @number_item.nil? - return false if @float_item.nil? - return false if @integer_item.nil? - return false if @bool_item.nil? - return false if @array_item.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - string_item == o.string_item && - number_item == o.number_item && - float_item == o.float_item && - integer_item == o.integer_item && - bool_item == o.bool_item && - array_item == o.array_item - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [string_item, number_item, float_item, integer_item, bool_item, array_item].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb deleted file mode 100644 index f9ff5c6e27bb..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb +++ /dev/null @@ -1,476 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class XmlItem - attr_accessor :attribute_string - - attr_accessor :attribute_number - - attr_accessor :attribute_integer - - attr_accessor :attribute_boolean - - attr_accessor :wrapped_array - - attr_accessor :name_string - - attr_accessor :name_number - - attr_accessor :name_integer - - attr_accessor :name_boolean - - attr_accessor :name_array - - attr_accessor :name_wrapped_array - - attr_accessor :prefix_string - - attr_accessor :prefix_number - - attr_accessor :prefix_integer - - attr_accessor :prefix_boolean - - attr_accessor :prefix_array - - attr_accessor :prefix_wrapped_array - - attr_accessor :namespace_string - - attr_accessor :namespace_number - - attr_accessor :namespace_integer - - attr_accessor :namespace_boolean - - attr_accessor :namespace_array - - attr_accessor :namespace_wrapped_array - - attr_accessor :prefix_ns_string - - attr_accessor :prefix_ns_number - - attr_accessor :prefix_ns_integer - - attr_accessor :prefix_ns_boolean - - attr_accessor :prefix_ns_array - - attr_accessor :prefix_ns_wrapped_array - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attribute_string' => :'attribute_string', - :'attribute_number' => :'attribute_number', - :'attribute_integer' => :'attribute_integer', - :'attribute_boolean' => :'attribute_boolean', - :'wrapped_array' => :'wrapped_array', - :'name_string' => :'name_string', - :'name_number' => :'name_number', - :'name_integer' => :'name_integer', - :'name_boolean' => :'name_boolean', - :'name_array' => :'name_array', - :'name_wrapped_array' => :'name_wrapped_array', - :'prefix_string' => :'prefix_string', - :'prefix_number' => :'prefix_number', - :'prefix_integer' => :'prefix_integer', - :'prefix_boolean' => :'prefix_boolean', - :'prefix_array' => :'prefix_array', - :'prefix_wrapped_array' => :'prefix_wrapped_array', - :'namespace_string' => :'namespace_string', - :'namespace_number' => :'namespace_number', - :'namespace_integer' => :'namespace_integer', - :'namespace_boolean' => :'namespace_boolean', - :'namespace_array' => :'namespace_array', - :'namespace_wrapped_array' => :'namespace_wrapped_array', - :'prefix_ns_string' => :'prefix_ns_string', - :'prefix_ns_number' => :'prefix_ns_number', - :'prefix_ns_integer' => :'prefix_ns_integer', - :'prefix_ns_boolean' => :'prefix_ns_boolean', - :'prefix_ns_array' => :'prefix_ns_array', - :'prefix_ns_wrapped_array' => :'prefix_ns_wrapped_array' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attribute_string' => :'String', - :'attribute_number' => :'Float', - :'attribute_integer' => :'Integer', - :'attribute_boolean' => :'Boolean', - :'wrapped_array' => :'Array', - :'name_string' => :'String', - :'name_number' => :'Float', - :'name_integer' => :'Integer', - :'name_boolean' => :'Boolean', - :'name_array' => :'Array', - :'name_wrapped_array' => :'Array', - :'prefix_string' => :'String', - :'prefix_number' => :'Float', - :'prefix_integer' => :'Integer', - :'prefix_boolean' => :'Boolean', - :'prefix_array' => :'Array', - :'prefix_wrapped_array' => :'Array', - :'namespace_string' => :'String', - :'namespace_number' => :'Float', - :'namespace_integer' => :'Integer', - :'namespace_boolean' => :'Boolean', - :'namespace_array' => :'Array', - :'namespace_wrapped_array' => :'Array', - :'prefix_ns_string' => :'String', - :'prefix_ns_number' => :'Float', - :'prefix_ns_integer' => :'Integer', - :'prefix_ns_boolean' => :'Boolean', - :'prefix_ns_array' => :'Array', - :'prefix_ns_wrapped_array' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::XmlItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::XmlItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attribute_string') - self.attribute_string = attributes[:'attribute_string'] - end - - if attributes.key?(:'attribute_number') - self.attribute_number = attributes[:'attribute_number'] - end - - if attributes.key?(:'attribute_integer') - self.attribute_integer = attributes[:'attribute_integer'] - end - - if attributes.key?(:'attribute_boolean') - self.attribute_boolean = attributes[:'attribute_boolean'] - end - - if attributes.key?(:'wrapped_array') - if (value = attributes[:'wrapped_array']).is_a?(Array) - self.wrapped_array = value - end - end - - if attributes.key?(:'name_string') - self.name_string = attributes[:'name_string'] - end - - if attributes.key?(:'name_number') - self.name_number = attributes[:'name_number'] - end - - if attributes.key?(:'name_integer') - self.name_integer = attributes[:'name_integer'] - end - - if attributes.key?(:'name_boolean') - self.name_boolean = attributes[:'name_boolean'] - end - - if attributes.key?(:'name_array') - if (value = attributes[:'name_array']).is_a?(Array) - self.name_array = value - end - end - - if attributes.key?(:'name_wrapped_array') - if (value = attributes[:'name_wrapped_array']).is_a?(Array) - self.name_wrapped_array = value - end - end - - if attributes.key?(:'prefix_string') - self.prefix_string = attributes[:'prefix_string'] - end - - if attributes.key?(:'prefix_number') - self.prefix_number = attributes[:'prefix_number'] - end - - if attributes.key?(:'prefix_integer') - self.prefix_integer = attributes[:'prefix_integer'] - end - - if attributes.key?(:'prefix_boolean') - self.prefix_boolean = attributes[:'prefix_boolean'] - end - - if attributes.key?(:'prefix_array') - if (value = attributes[:'prefix_array']).is_a?(Array) - self.prefix_array = value - end - end - - if attributes.key?(:'prefix_wrapped_array') - if (value = attributes[:'prefix_wrapped_array']).is_a?(Array) - self.prefix_wrapped_array = value - end - end - - if attributes.key?(:'namespace_string') - self.namespace_string = attributes[:'namespace_string'] - end - - if attributes.key?(:'namespace_number') - self.namespace_number = attributes[:'namespace_number'] - end - - if attributes.key?(:'namespace_integer') - self.namespace_integer = attributes[:'namespace_integer'] - end - - if attributes.key?(:'namespace_boolean') - self.namespace_boolean = attributes[:'namespace_boolean'] - end - - if attributes.key?(:'namespace_array') - if (value = attributes[:'namespace_array']).is_a?(Array) - self.namespace_array = value - end - end - - if attributes.key?(:'namespace_wrapped_array') - if (value = attributes[:'namespace_wrapped_array']).is_a?(Array) - self.namespace_wrapped_array = value - end - end - - if attributes.key?(:'prefix_ns_string') - self.prefix_ns_string = attributes[:'prefix_ns_string'] - end - - if attributes.key?(:'prefix_ns_number') - self.prefix_ns_number = attributes[:'prefix_ns_number'] - end - - if attributes.key?(:'prefix_ns_integer') - self.prefix_ns_integer = attributes[:'prefix_ns_integer'] - end - - if attributes.key?(:'prefix_ns_boolean') - self.prefix_ns_boolean = attributes[:'prefix_ns_boolean'] - end - - if attributes.key?(:'prefix_ns_array') - if (value = attributes[:'prefix_ns_array']).is_a?(Array) - self.prefix_ns_array = value - end - end - - if attributes.key?(:'prefix_ns_wrapped_array') - if (value = attributes[:'prefix_ns_wrapped_array']).is_a?(Array) - self.prefix_ns_wrapped_array = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attribute_string == o.attribute_string && - attribute_number == o.attribute_number && - attribute_integer == o.attribute_integer && - attribute_boolean == o.attribute_boolean && - wrapped_array == o.wrapped_array && - name_string == o.name_string && - name_number == o.name_number && - name_integer == o.name_integer && - name_boolean == o.name_boolean && - name_array == o.name_array && - name_wrapped_array == o.name_wrapped_array && - prefix_string == o.prefix_string && - prefix_number == o.prefix_number && - prefix_integer == o.prefix_integer && - prefix_boolean == o.prefix_boolean && - prefix_array == o.prefix_array && - prefix_wrapped_array == o.prefix_wrapped_array && - namespace_string == o.namespace_string && - namespace_number == o.namespace_number && - namespace_integer == o.namespace_integer && - namespace_boolean == o.namespace_boolean && - namespace_array == o.namespace_array && - namespace_wrapped_array == o.namespace_wrapped_array && - prefix_ns_string == o.prefix_ns_string && - prefix_ns_number == o.prefix_ns_number && - prefix_ns_integer == o.prefix_ns_integer && - prefix_ns_boolean == o.prefix_ns_boolean && - prefix_ns_array == o.prefix_ns_array && - prefix_ns_wrapped_array == o.prefix_ns_wrapped_array - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attribute_string, attribute_number, attribute_integer, attribute_boolean, wrapped_array, name_string, name_number, name_integer, name_boolean, name_array, name_wrapped_array, prefix_string, prefix_number, prefix_integer, prefix_boolean, prefix_array, prefix_wrapped_array, namespace_string, namespace_number, namespace_integer, namespace_boolean, namespace_array, namespace_wrapped_array, prefix_ns_string, prefix_ns_number, prefix_ns_integer, prefix_ns_boolean, prefix_ns_array, prefix_ns_wrapped_array].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/pom.xml b/samples/client/petstore/ruby-faraday/pom.xml similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/pom.xml rename to samples/client/petstore/ruby-faraday/pom.xml diff --git a/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb index 010f6a9d2982..bf187f0971fe 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -35,7 +35,7 @@ # unit tests for call_123_test_special_tags # To test special tags # To test special tags and operation ID starting with number - # @param body client model + # @param client client model # @param [Hash] opts the optional parameters # @return [Client] describe 'call_123_test_special_tags test' do diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/default_api_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb rename to samples/client/petstore/ruby-faraday/spec/api/default_api_spec.rb diff --git a/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb index 7274fbf1639d..7374568eaf0d 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -32,13 +32,24 @@ end end - # unit tests for create_xml_item - # creates an XmlItem - # this route creates an XmlItem - # @param xml_item XmlItem Body + # unit tests for fake_health_get + # Health check endpoint # @param [Hash] opts the optional parameters + # @return [HealthCheckResult] + describe 'fake_health_get test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_http_signature_test + # test http signature authentication + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter # @return [nil] - describe 'create_xml_item test' do + describe 'fake_http_signature_test test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end @@ -58,7 +69,7 @@ # unit tests for fake_outer_composite_serialize # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :body Input composite as post body + # @option opts [OuterComposite] :outer_composite Input composite as post body # @return [OuterComposite] describe 'fake_outer_composite_serialize test' do it 'should work' do @@ -90,7 +101,7 @@ # unit tests for test_body_with_file_schema # For this test, the body for this request much reference a schema named `File`. - # @param body + # @param file_schema_test_class # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_file_schema test' do @@ -101,7 +112,7 @@ # unit tests for test_body_with_query_params # @param query - # @param body + # @param user # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_query_params test' do @@ -113,7 +124,7 @@ # unit tests for test_client_model # To test \"client\" model # To test \"client\" model - # @param body client model + # @param client client model # @param [Hash] opts the optional parameters # @return [Client] describe 'test_client_model test' do @@ -185,7 +196,7 @@ # unit tests for test_inline_additional_properties # test inline additionalProperties - # @param param request body + # @param request_body request body # @param [Hash] opts the optional parameters # @return [nil] describe 'test_inline_additional_properties test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb index 4ec82d7d8a01..1db2b3c9ef52 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -35,7 +35,7 @@ # unit tests for test_classname # To test class name in snake case # To test class name in snake case - # @param body client model + # @param client client model # @param [Hash] opts the optional parameters # @return [Client] describe 'test_classname test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb index fa122fb777fa..26ca32b2f754 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -34,7 +34,7 @@ # unit tests for add_pet # Add a new pet to the store - # @param body Pet object that needs to be added to the store + # @param pet Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] describe 'add_pet test' do @@ -93,7 +93,7 @@ # unit tests for update_pet # Update an existing pet - # @param body Pet object that needs to be added to the store + # @param pet Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] describe 'update_pet test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb index cc7ff08491dd..1fd9faf40aaf 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -69,7 +69,7 @@ # unit tests for place_order # Place an order for a pet - # @param body order placed for purchasing the pet + # @param order order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] describe 'place_order test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb index 5000c2856076..39178c5a5ac7 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -35,7 +35,7 @@ # unit tests for create_user # Create user # This can only be done by the logged in user. - # @param body Created user object + # @param user Created user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_user test' do @@ -46,7 +46,7 @@ # unit tests for create_users_with_array_input # Creates list of users with given input array - # @param body List of user object + # @param user List of user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_users_with_array_input test' do @@ -57,7 +57,7 @@ # unit tests for create_users_with_list_input # Creates list of users with given input array - # @param body List of user object + # @param user List of user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_users_with_list_input test' do @@ -115,7 +115,7 @@ # Updated user # This can only be done by the logged in user. # @param username name that need to be deleted - # @param body Updated user object + # @param user Updated user object # @param [Hash] opts the optional parameters # @return [nil] describe 'update_user test' do diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/api_error_spec.rb b/samples/client/petstore/ruby-faraday/spec/custom/api_error_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/custom/api_error_spec.rb rename to samples/client/petstore/ruby-faraday/spec/custom/api_error_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/base_object_spec.rb b/samples/client/petstore/ruby-faraday/spec/custom/base_object_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/custom/base_object_spec.rb rename to samples/client/petstore/ruby-faraday/spec/custom/base_object_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb b/samples/client/petstore/ruby-faraday/spec/custom/pet_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb rename to samples/client/petstore/ruby-faraday/spec/custom/pet_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/store_spec.rb b/samples/client/petstore/ruby-faraday/spec/custom/store_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/custom/store_spec.rb rename to samples/client/petstore/ruby-faraday/spec/custom/store_spec.rb diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb deleted file mode 100644 index 08020d33f8a5..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesAnyType -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesAnyType' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesAnyType.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesAnyType' do - it 'should create an instance of AdditionalPropertiesAnyType' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesAnyType) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb deleted file mode 100644 index dc6fd5efd138..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesArray -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesArray' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesArray.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesArray' do - it 'should create an instance of AdditionalPropertiesArray' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesArray) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb deleted file mode 100644 index 0fc72b039e71..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesBoolean -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesBoolean' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesBoolean.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesBoolean' do - it 'should create an instance of AdditionalPropertiesBoolean' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesBoolean) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb index 9f02de5e8378..93a5b0d5fb46 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -32,67 +32,13 @@ expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass) end end - describe 'test attribute "map_string"' do + describe 'test attribute "map_property"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "map_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_array_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_array_anytype"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_map_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_map_anytype"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "anytype_1"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "anytype_2"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "anytype_3"' do + describe 'test attribute "map_of_map_property"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb deleted file mode 100644 index 7b41f50034cc..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesInteger -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesInteger' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesInteger.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesInteger' do - it 'should create an instance of AdditionalPropertiesInteger' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesInteger) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb deleted file mode 100644 index a1ed8d033e29..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesNumber -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesNumber' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesNumber.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesNumber' do - it 'should create an instance of AdditionalPropertiesNumber' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesNumber) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb deleted file mode 100644 index 047b92b9d8e0..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesObject -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesObject' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesObject.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesObject' do - it 'should create an instance of AdditionalPropertiesObject' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesObject) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb deleted file mode 100644 index 31504659528f..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesString -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesString' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesString.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesString' do - it 'should create an instance of AdditionalPropertiesString' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesString) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb index 6689296c03c8..8b3e9adc5378 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb index 7788def0381a..628f1c4d7c17 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb index e0af34704312..ea41c9a4b380 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb index 8c3c137d6711..ba90932a7976 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb index 046dfd0b6fef..6ff7397ad43c 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb deleted file mode 100644 index 4a547a5ac504..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.2-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::BigCatAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'BigCatAllOf' do - before do - # run before each test - @instance = Petstore::BigCatAllOf.new - end - - after do - # run after each test - end - - describe 'test an instance of BigCatAllOf' do - it 'should create an instance of BigCatAllOf' do - expect(@instance).to be_instance_of(Petstore::BigCatAllOf) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { @instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb deleted file mode 100644 index c6e0cfbce688..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.2-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::BigCat -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'BigCat' do - before do - # run before each test - @instance = Petstore::BigCat.new - end - - after do - # run after each test - end - - describe 'test an instance of BigCat' do - it 'should create an instance of BigCat' do - expect(@instance).to be_instance_of(Petstore::BigCat) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { @instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb index 79bdc3700e0a..451c59af970f 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb index 55be1ba89dc7..926ce8a2a37e 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb index 3a549f61b0ae..3efb677ce64f 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb index 92815daf8713..82ecd78d9666 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb index 1348f4108d9c..761e89331276 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb index d9f698219f01..4bf1ce0622b1 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb index 797e3ac4190d..5596927d4235 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb index b5974e6bc280..b82df3e9d72d 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb index d8b99761ca2a..ac75c92581db 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb index ac9f99d1d881..29fcd05aa750 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb index eab1cf34db8c..7f4c9c97e871 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -78,4 +78,22 @@ end end + describe 'test attribute "outer_enum_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "outer_enum_default_value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "outer_enum_integer_default_value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb index ce16c64d96fe..8a8d92658c97 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb index 9ea07d98919b..b9d1499766ee 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/foo_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/foo_spec.rb diff --git a/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb index d2bdad7a4ec6..72fe239f298e 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end @@ -110,7 +110,13 @@ end end - describe 'test attribute "big_decimal"' do + describe 'test attribute "pattern_with_digits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern_with_digits_and_delimiter"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb index f74766f78385..9efa03a22fe0 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb diff --git a/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb index 85af1ebc1b83..db397aa108fa 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb index db8bcc93c75c..f7ff6788b095 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb index f85e4fc0ab35..0e88f4725244 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb index 48514051cedf..133f6b94c145 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb index 4686c6e58cb5..57d400eb1169 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb index acb40b437610..c882db4f2215 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb diff --git a/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb index 622474911e8c..0963591fcc12 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb index b9207c7f8265..3f1d973b2751 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb index 5e2770aa81b5..bb36f4889592 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb rename to samples/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb diff --git a/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb index 76b297bb92f9..ea9762da93bf 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb index 05d663984167..dc0a0898c9ff 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb index 8c9dc8faa6e8..8d60e4433132 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb index c37ebaff67c8..b548f7f0951d 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb index 8cd9c57394ee..3a7454390401 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb deleted file mode 100644 index ff2125690229..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb +++ /dev/null @@ -1,65 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::TypeHolderDefault -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'TypeHolderDefault' do - before do - # run before each test - @instance = Petstore::TypeHolderDefault.new - end - - after do - # run after each test - end - - describe 'test an instance of TypeHolderDefault' do - it 'should create an instance of TypeHolderDefault' do - expect(@instance).to be_instance_of(Petstore::TypeHolderDefault) - end - end - describe 'test attribute "string_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "number_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "integer_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "bool_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "array_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb deleted file mode 100644 index 9cd3cbe37e87..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::TypeHolderExample -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'TypeHolderExample' do - before do - # run before each test - @instance = Petstore::TypeHolderExample.new - end - - after do - # run after each test - end - - describe 'test an instance of TypeHolderExample' do - it 'should create an instance of TypeHolderExample' do - expect(@instance).to be_instance_of(Petstore::TypeHolderExample) - end - end - describe 'test attribute "string_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "number_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "float_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "integer_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "bool_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "array_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb index 685280b7adc0..2eb31e993a09 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT +OpenAPI Generator version: 5.0.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb deleted file mode 100644 index 34d7837b2fb3..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb +++ /dev/null @@ -1,209 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::XmlItem -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'XmlItem' do - before do - # run before each test - @instance = Petstore::XmlItem.new - end - - after do - # run after each test - end - - describe 'test an instance of XmlItem' do - it 'should create an instance of XmlItem' do - expect(@instance).to be_instance_of(Petstore::XmlItem) - end - end - describe 'test attribute "attribute_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "attribute_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "attribute_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "attribute_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb b/samples/client/petstore/ruby-faraday/spec/petstore_helper.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb rename to samples/client/petstore/ruby-faraday/spec/petstore_helper.rb diff --git a/samples/client/petstore/ruby/.openapi-generator/FILES b/samples/client/petstore/ruby/.openapi-generator/FILES index b85126833469..61a40c4b9a02 100644 --- a/samples/client/petstore/ruby/.openapi-generator/FILES +++ b/samples/client/petstore/ruby/.openapi-generator/FILES @@ -5,28 +5,20 @@ Gemfile README.md Rakefile -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md docs/Animal.md docs/AnotherFakeApi.md docs/ApiResponse.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md docs/Capitalization.md docs/Cat.md docs/CatAllOf.md docs/Category.md docs/ClassModel.md docs/Client.md +docs/DefaultApi.md docs/Dog.md docs/DogAllOf.md docs/EnumArrays.md @@ -36,32 +28,43 @@ docs/FakeApi.md docs/FakeClassnameTags123Api.md docs/File.md docs/FileSchemaTestClass.md +docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md docs/List.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md docs/ModelReturn.md docs/Name.md +docs/NullableClass.md docs/NumberOnly.md docs/Order.md docs/OuterComposite.md docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md docs/User.md docs/UserApi.md -docs/XmlItem.md git_push.sh lib/petstore.rb lib/petstore/api/another_fake_api.rb +lib/petstore/api/default_api.rb lib/petstore/api/fake_api.rb lib/petstore/api/fake_classname_tags123_api.rb lib/petstore/api/pet_api.rb @@ -71,21 +74,12 @@ lib/petstore/api_client.rb lib/petstore/api_error.rb lib/petstore/configuration.rb lib/petstore/configuration.rb -lib/petstore/models/additional_properties_any_type.rb -lib/petstore/models/additional_properties_array.rb -lib/petstore/models/additional_properties_boolean.rb lib/petstore/models/additional_properties_class.rb -lib/petstore/models/additional_properties_integer.rb -lib/petstore/models/additional_properties_number.rb -lib/petstore/models/additional_properties_object.rb -lib/petstore/models/additional_properties_string.rb lib/petstore/models/animal.rb lib/petstore/models/api_response.rb lib/petstore/models/array_of_array_of_number_only.rb lib/petstore/models/array_of_number_only.rb lib/petstore/models/array_test.rb -lib/petstore/models/big_cat.rb -lib/petstore/models/big_cat_all_of.rb lib/petstore/models/capitalization.rb lib/petstore/models/cat.rb lib/petstore/models/cat_all_of.rb @@ -99,29 +93,40 @@ lib/petstore/models/enum_class.rb lib/petstore/models/enum_test.rb lib/petstore/models/file.rb lib/petstore/models/file_schema_test_class.rb +lib/petstore/models/foo.rb lib/petstore/models/format_test.rb lib/petstore/models/has_only_read_only.rb +lib/petstore/models/health_check_result.rb +lib/petstore/models/inline_object.rb +lib/petstore/models/inline_object1.rb +lib/petstore/models/inline_object2.rb +lib/petstore/models/inline_object3.rb +lib/petstore/models/inline_object4.rb +lib/petstore/models/inline_object5.rb +lib/petstore/models/inline_response_default.rb lib/petstore/models/list.rb lib/petstore/models/map_test.rb lib/petstore/models/mixed_properties_and_additional_properties_class.rb lib/petstore/models/model200_response.rb lib/petstore/models/model_return.rb lib/petstore/models/name.rb +lib/petstore/models/nullable_class.rb lib/petstore/models/number_only.rb lib/petstore/models/order.rb lib/petstore/models/outer_composite.rb lib/petstore/models/outer_enum.rb +lib/petstore/models/outer_enum_default_value.rb +lib/petstore/models/outer_enum_integer.rb +lib/petstore/models/outer_enum_integer_default_value.rb lib/petstore/models/pet.rb lib/petstore/models/read_only_first.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb -lib/petstore/models/type_holder_default.rb -lib/petstore/models/type_holder_example.rb lib/petstore/models/user.rb -lib/petstore/models/xml_item.rb lib/petstore/version.rb petstore.gemspec spec/api/another_fake_api_spec.rb +spec/api/default_api_spec.rb spec/api/fake_api_spec.rb spec/api/fake_classname_tags123_api_spec.rb spec/api/pet_api_spec.rb @@ -129,21 +134,12 @@ spec/api/store_api_spec.rb spec/api/user_api_spec.rb spec/api_client_spec.rb spec/configuration_spec.rb -spec/models/additional_properties_any_type_spec.rb -spec/models/additional_properties_array_spec.rb -spec/models/additional_properties_boolean_spec.rb spec/models/additional_properties_class_spec.rb -spec/models/additional_properties_integer_spec.rb -spec/models/additional_properties_number_spec.rb -spec/models/additional_properties_object_spec.rb -spec/models/additional_properties_string_spec.rb spec/models/animal_spec.rb spec/models/api_response_spec.rb spec/models/array_of_array_of_number_only_spec.rb spec/models/array_of_number_only_spec.rb spec/models/array_test_spec.rb -spec/models/big_cat_all_of_spec.rb -spec/models/big_cat_spec.rb spec/models/capitalization_spec.rb spec/models/cat_all_of_spec.rb spec/models/cat_spec.rb @@ -157,24 +153,34 @@ spec/models/enum_class_spec.rb spec/models/enum_test_spec.rb spec/models/file_schema_test_class_spec.rb spec/models/file_spec.rb +spec/models/foo_spec.rb spec/models/format_test_spec.rb spec/models/has_only_read_only_spec.rb +spec/models/health_check_result_spec.rb +spec/models/inline_object1_spec.rb +spec/models/inline_object2_spec.rb +spec/models/inline_object3_spec.rb +spec/models/inline_object4_spec.rb +spec/models/inline_object5_spec.rb +spec/models/inline_object_spec.rb +spec/models/inline_response_default_spec.rb spec/models/list_spec.rb spec/models/map_test_spec.rb spec/models/mixed_properties_and_additional_properties_class_spec.rb spec/models/model200_response_spec.rb spec/models/model_return_spec.rb spec/models/name_spec.rb +spec/models/nullable_class_spec.rb spec/models/number_only_spec.rb spec/models/order_spec.rb spec/models/outer_composite_spec.rb +spec/models/outer_enum_default_value_spec.rb +spec/models/outer_enum_integer_default_value_spec.rb +spec/models/outer_enum_integer_spec.rb spec/models/outer_enum_spec.rb spec/models/pet_spec.rb spec/models/read_only_first_spec.rb spec/models/special_model_name_spec.rb spec/models/tag_spec.rb -spec/models/type_holder_default_spec.rb -spec/models/type_holder_example_spec.rb spec/models/user_spec.rb -spec/models/xml_item_spec.rb spec/spec_helper.rb diff --git a/samples/client/petstore/ruby/Gemfile.lock b/samples/client/petstore/ruby/Gemfile.lock deleted file mode 100644 index 14030efc945a..000000000000 --- a/samples/client/petstore/ruby/Gemfile.lock +++ /dev/null @@ -1,79 +0,0 @@ -PATH - remote: . - specs: - petstore (1.0.0) - json (~> 2.1, >= 2.1.0) - typhoeus (~> 1.0, >= 1.0.1) - -GEM - remote: https://rubygems.org/ - specs: - ZenTest (4.11.2) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - autotest (4.4.6) - ZenTest (>= 4.4.1) - autotest-fsevent (0.2.14) - sys-uname - autotest-growl (0.2.16) - autotest-rails-pure (4.1.2) - byebug (10.0.2) - coderay (1.1.2) - crack (0.4.3) - safe_yaml (~> 1.0.0) - diff-lcs (1.3) - ethon (0.11.0) - ffi (>= 1.3.0) - ffi (1.9.25) - hashdiff (0.3.7) - json (2.1.0) - method_source (0.9.0) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - pry-byebug (3.6.0) - byebug (~> 10.0) - pry (~> 0.10) - public_suffix (3.0.3) - rake (12.0.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - safe_yaml (1.0.4) - sys-uname (1.0.3) - ffi (>= 1.0.0) - typhoeus (1.3.0) - ethon (>= 0.9.0) - vcr (3.0.3) - webmock (1.24.6) - addressable (>= 2.3.6) - crack (>= 0.3.2) - hashdiff - -PLATFORMS - ruby - -DEPENDENCIES - autotest (~> 4.4, >= 4.4.6) - autotest-fsevent (~> 0.2, >= 0.2.12) - autotest-growl (~> 0.2, >= 0.2.16) - autotest-rails-pure (~> 4.1, >= 4.1.2) - petstore! - pry-byebug - rake (~> 12.0.0) - rspec (~> 3.6, >= 3.6.0) - vcr (~> 3.0, >= 3.0.1) - webmock (~> 1.24, >= 1.24.3) - -BUNDLED WITH - 1.16.1 diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 8255487cce6f..719039e53116 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -57,11 +57,11 @@ Please follow the [installation](#installation) procedure and then run the follo require 'petstore' api_instance = Petstore::AnotherFakeApi.new -body = Petstore::Client.new # Client | client model +client = Petstore::Client.new # Client | client model begin #To test special tags - result = api_instance.call_123_test_special_tags(body) + result = api_instance.call_123_test_special_tags(client) p result rescue Petstore::ApiError => e puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" @@ -76,7 +76,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*Petstore::FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +*Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -84,7 +86,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *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_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_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -116,21 +118,12 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [Petstore::AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [Petstore::AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [Petstore::AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Petstore::AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [Petstore::AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [Petstore::AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [Petstore::AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Petstore::Animal](docs/Animal.md) - [Petstore::ApiResponse](docs/ApiResponse.md) - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Petstore::ArrayTest](docs/ArrayTest.md) - - [Petstore::BigCat](docs/BigCat.md) - - [Petstore::BigCatAllOf](docs/BigCatAllOf.md) - [Petstore::Capitalization](docs/Capitalization.md) - [Petstore::Cat](docs/Cat.md) - [Petstore::CatAllOf](docs/CatAllOf.md) @@ -144,26 +137,36 @@ Class | Method | HTTP request | Description - [Petstore::EnumTest](docs/EnumTest.md) - [Petstore::File](docs/File.md) - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Petstore::Foo](docs/Foo.md) - [Petstore::FormatTest](docs/FormatTest.md) - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) + - [Petstore::InlineObject](docs/InlineObject.md) + - [Petstore::InlineObject1](docs/InlineObject1.md) + - [Petstore::InlineObject2](docs/InlineObject2.md) + - [Petstore::InlineObject3](docs/InlineObject3.md) + - [Petstore::InlineObject4](docs/InlineObject4.md) + - [Petstore::InlineObject5](docs/InlineObject5.md) + - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) - [Petstore::List](docs/List.md) - [Petstore::MapTest](docs/MapTest.md) - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Petstore::Model200Response](docs/Model200Response.md) - [Petstore::ModelReturn](docs/ModelReturn.md) - [Petstore::Name](docs/Name.md) + - [Petstore::NullableClass](docs/NullableClass.md) - [Petstore::NumberOnly](docs/NumberOnly.md) - [Petstore::Order](docs/Order.md) - [Petstore::OuterComposite](docs/OuterComposite.md) - [Petstore::OuterEnum](docs/OuterEnum.md) + - [Petstore::OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [Petstore::OuterEnumInteger](docs/OuterEnumInteger.md) + - [Petstore::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - - [Petstore::TypeHolderDefault](docs/TypeHolderDefault.md) - - [Petstore::TypeHolderExample](docs/TypeHolderExample.md) - [Petstore::User](docs/User.md) - - [Petstore::XmlItem](docs/XmlItem.md) ## Documentation for Authorization @@ -183,10 +186,17 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key_query - **Location**: URL query string +### bearer_test + +- **Type**: Bearer authentication (JWT) + ### http_basic_test - **Type**: HTTP basic authentication +### http_signature_test + + ### petstore_auth diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index d61613cab354..000000000000 --- a/samples/client/petstore/ruby/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesAnyType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesAnyType.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesArray.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 27b9024ef27e..000000000000 --- a/samples/client/petstore/ruby/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesArray - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesArray.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index 8e64a21f91ed..000000000000 --- a/samples/client/petstore/ruby/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesBoolean - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesBoolean.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesClass.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesClass.md index 353033010b29..e0d6811081cd 100644 --- a/samples/client/petstore/ruby/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/ruby/docs/AdditionalPropertiesClass.md @@ -4,34 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_string** | **Hash<String, String>** | | [optional] -**map_number** | **Hash<String, Float>** | | [optional] -**map_integer** | **Hash<String, Integer>** | | [optional] -**map_boolean** | **Hash<String, Boolean>** | | [optional] -**map_array_integer** | **Hash<String, Array<Integer>>** | | [optional] -**map_array_anytype** | **Hash<String, Array<Object>>** | | [optional] -**map_map_string** | **Hash<String, Hash<String, String>>** | | [optional] -**map_map_anytype** | **Hash<String, Hash<String, Object>>** | | [optional] -**anytype_1** | **Object** | | [optional] -**anytype_2** | **Object** | | [optional] -**anytype_3** | **Object** | | [optional] +**map_property** | **Hash<String, String>** | | [optional] +**map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional] ## Code Sample ```ruby require 'Petstore' -instance = Petstore::AdditionalPropertiesClass.new(map_string: null, - map_number: null, - map_integer: null, - map_boolean: null, - map_array_integer: null, - map_array_anytype: null, - map_map_string: null, - map_map_anytype: null, - anytype_1: null, - anytype_2: null, - anytype_3: null) +instance = Petstore::AdditionalPropertiesClass.new(map_property: null, + map_of_map_property: null) ``` diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 2e198d2814a1..000000000000 --- a/samples/client/petstore/ruby/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesInteger - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesInteger.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 419cec4a56d3..000000000000 --- a/samples/client/petstore/ruby/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesNumber - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesNumber.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesObject.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesObject.md deleted file mode 100644 index bd6525eac26a..000000000000 --- a/samples/client/petstore/ruby/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesObject.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesString.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesString.md deleted file mode 100644 index e6941073f289..000000000000 --- a/samples/client/petstore/ruby/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::AdditionalPropertiesString - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesString.new(name: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/AnotherFakeApi.md b/samples/client/petstore/ruby/docs/AnotherFakeApi.md index 71a7a54d9912..d7b52283ea50 100644 --- a/samples/client/petstore/ruby/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby/docs/AnotherFakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## call_123_test_special_tags -> Client call_123_test_special_tags(body) +> Client call_123_test_special_tags(client) To test special tags @@ -23,11 +23,11 @@ To test special tags and operation ID starting with number require 'petstore' api_instance = Petstore::AnotherFakeApi.new -body = Petstore::Client.new # Client | client model +client = Petstore::Client.new # Client | client model begin #To test special tags - result = api_instance.call_123_test_special_tags(body) + result = api_instance.call_123_test_special_tags(client) p result rescue Petstore::ApiError => e puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" @@ -39,7 +39,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/ruby/docs/BigCat.md b/samples/client/petstore/ruby/docs/BigCat.md deleted file mode 100644 index 7c48311d4223..000000000000 --- a/samples/client/petstore/ruby/docs/BigCat.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::BigCat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::BigCat.new(kind: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/BigCatAllOf.md b/samples/client/petstore/ruby/docs/BigCatAllOf.md deleted file mode 100644 index 101cad0da23b..000000000000 --- a/samples/client/petstore/ruby/docs/BigCatAllOf.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::BigCatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::BigCatAllOf.new(kind: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/DefaultApi.md b/samples/client/petstore/ruby/docs/DefaultApi.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/DefaultApi.md rename to samples/client/petstore/ruby/docs/DefaultApi.md diff --git a/samples/client/petstore/ruby/docs/EnumTest.md b/samples/client/petstore/ruby/docs/EnumTest.md index 41059ae76e63..e43f07205363 100644 --- a/samples/client/petstore/ruby/docs/EnumTest.md +++ b/samples/client/petstore/ruby/docs/EnumTest.md @@ -9,6 +9,9 @@ Name | Type | Description | Notes **enum_integer** | **Integer** | | [optional] **enum_number** | **Float** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] ## Code Sample @@ -19,7 +22,10 @@ instance = Petstore::EnumTest.new(enum_string: null, enum_string_required: null, enum_integer: null, enum_number: null, - outer_enum: null) + outer_enum: null, + outer_enum_integer: null, + outer_enum_default_value: null, + outer_enum_integer_default_value: null) ``` diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 43b7961e5be4..4552514bc792 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -4,7 +4,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -12,7 +13,7 @@ Method | HTTP request | Description [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**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_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_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -21,28 +22,74 @@ Method | HTTP request | Description -## create_xml_item +## fake_health_get -> create_xml_item(xml_item) +> HealthCheckResult fake_health_get -creates an XmlItem +Health check endpoint -this route creates an XmlItem +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +begin + #Health check endpoint + result = api_instance.fake_health_get + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_health_get: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## fake_http_signature_test + +> fake_http_signature_test(pet, opts) + +test http signature authentication ### Example ```ruby # load the gem require 'petstore' +# setup authorization +Petstore.configure do |config| +end api_instance = Petstore::FakeApi.new -xml_item = Petstore::XmlItem.new # XmlItem | XmlItem Body +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +opts = { + query_1: 'query_1_example', # String | query parameter + header_1: 'header_1_example' # String | header parameter +} begin - #creates an XmlItem - api_instance.create_xml_item(xml_item) + #test http signature authentication + api_instance.fake_http_signature_test(pet, opts) rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->create_xml_item: #{e}" + puts "Exception when calling FakeApi->fake_http_signature_test: #{e}" end ``` @@ -51,7 +98,9 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query_1** | **String**| query parameter | [optional] + **header_1** | **String**| header parameter | [optional] ### Return type @@ -59,11 +108,11 @@ nil (empty response body) ### Authorization -No authorization required +[http_signature_test](../README.md#http_signature_test) ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 +- **Content-Type**: application/json, application/xml - **Accept**: Not defined @@ -111,7 +160,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* @@ -131,7 +180,7 @@ require 'petstore' api_instance = Petstore::FakeApi.new opts = { - body: Petstore::OuterComposite.new # OuterComposite | Input composite as post body + outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body } begin @@ -147,7 +196,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -159,7 +208,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* @@ -207,7 +256,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* @@ -255,13 +304,13 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* ## test_body_with_file_schema -> test_body_with_file_schema(body) +> test_body_with_file_schema(file_schema_test_class) @@ -274,10 +323,10 @@ For this test, the body for this request much reference a schema named `File`. require 'petstore' api_instance = Petstore::FakeApi.new -body = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | +file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | begin - api_instance.test_body_with_file_schema(body) + api_instance.test_body_with_file_schema(file_schema_test_class) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}" end @@ -288,7 +337,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -306,7 +355,7 @@ No authorization required ## test_body_with_query_params -> test_body_with_query_params(query, body) +> test_body_with_query_params(query, user) @@ -318,10 +367,10 @@ require 'petstore' api_instance = Petstore::FakeApi.new query = 'query_example' # String | -body = Petstore::User.new # User | +user = Petstore::User.new # User | begin - api_instance.test_body_with_query_params(query, body) + api_instance.test_body_with_query_params(query, user) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_body_with_query_params: #{e}" end @@ -333,7 +382,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **String**| | - **body** | [**User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -351,7 +400,7 @@ No authorization required ## test_client_model -> Client test_client_model(body) +> Client test_client_model(client) To test \"client\" model @@ -364,11 +413,11 @@ To test \"client\" model require 'petstore' api_instance = Petstore::FakeApi.new -body = Petstore::Client.new # Client | client model +client = Petstore::Client.new # Client | client model begin #To test \"client\" model - result = api_instance.test_client_model(body) + result = api_instance.test_client_model(client) p result rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_client_model: #{e}" @@ -380,7 +429,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -400,9 +449,9 @@ No authorization required > test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example @@ -435,7 +484,7 @@ opts = { } begin - #Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + #Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_endpoint_parameters: #{e}" @@ -551,6 +600,11 @@ Fake endpoint to test group parameters (optional) ```ruby # load the gem require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure Bearer authorization (JWT): bearer_test + config.access_token = 'YOUR_BEARER_TOKEN' +end api_instance = Petstore::FakeApi.new required_string_group = 56 # Integer | Required String in group parameters @@ -588,7 +642,7 @@ nil (empty response body) ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers @@ -598,7 +652,7 @@ No authorization required ## test_inline_additional_properties -> test_inline_additional_properties(param) +> test_inline_additional_properties(request_body) test inline additionalProperties @@ -609,11 +663,11 @@ test inline additionalProperties require 'petstore' api_instance = Petstore::FakeApi.new -param = {'key' => 'param_example'} # Hash | request body +request_body = {'key' => 'request_body_example'} # Hash | request body begin #test inline additionalProperties - api_instance.test_inline_additional_properties(param) + api_instance.test_inline_additional_properties(request_body) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" end @@ -624,7 +678,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**Hash<String, String>**](String.md)| request body | + **request_body** | [**Hash<String, String>**](String.md)| request body | ### Return type diff --git a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md index 97f8ea959a7c..4ccb9083cbae 100644 --- a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_classname -> Client test_classname(body) +> Client test_classname(client) To test class name in snake case @@ -30,11 +30,11 @@ Petstore.configure do |config| end api_instance = Petstore::FakeClassnameTags123Api.new -body = Petstore::Client.new # Client | client model +client = Petstore::Client.new # Client | client model begin #To test class name in snake case - result = api_instance.test_classname(body) + result = api_instance.test_classname(client) p result rescue Petstore::ApiError => e puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}" @@ -46,7 +46,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/openapi3/client/petstore/ruby/docs/Foo.md b/samples/client/petstore/ruby/docs/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/Foo.md rename to samples/client/petstore/ruby/docs/Foo.md diff --git a/samples/client/petstore/ruby/docs/FormatTest.md b/samples/client/petstore/ruby/docs/FormatTest.md index 6c1ba0be6318..ca468a3d6506 100644 --- a/samples/client/petstore/ruby/docs/FormatTest.md +++ b/samples/client/petstore/ruby/docs/FormatTest.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **date_time** | **DateTime** | | [optional] **uuid** | **String** | | [optional] **password** | **String** | | -**big_decimal** | [**BigDecimal**](BigDecimal.md) | | [optional] +**pattern_with_digits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] ## Code Sample @@ -37,7 +38,8 @@ instance = Petstore::FormatTest.new(integer: null, date_time: null, uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84, password: null, - big_decimal: null) + pattern_with_digits: null, + pattern_with_digits_and_delimiter: null) ``` diff --git a/samples/openapi3/client/petstore/ruby/docs/HealthCheckResult.md b/samples/client/petstore/ruby/docs/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/HealthCheckResult.md rename to samples/client/petstore/ruby/docs/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/ruby/docs/InlineObject.md b/samples/client/petstore/ruby/docs/InlineObject.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/InlineObject.md rename to samples/client/petstore/ruby/docs/InlineObject.md diff --git a/samples/openapi3/client/petstore/ruby/docs/InlineObject1.md b/samples/client/petstore/ruby/docs/InlineObject1.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/InlineObject1.md rename to samples/client/petstore/ruby/docs/InlineObject1.md diff --git a/samples/openapi3/client/petstore/ruby/docs/InlineObject2.md b/samples/client/petstore/ruby/docs/InlineObject2.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/InlineObject2.md rename to samples/client/petstore/ruby/docs/InlineObject2.md diff --git a/samples/openapi3/client/petstore/ruby/docs/InlineObject3.md b/samples/client/petstore/ruby/docs/InlineObject3.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/InlineObject3.md rename to samples/client/petstore/ruby/docs/InlineObject3.md diff --git a/samples/openapi3/client/petstore/ruby/docs/InlineObject4.md b/samples/client/petstore/ruby/docs/InlineObject4.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/InlineObject4.md rename to samples/client/petstore/ruby/docs/InlineObject4.md diff --git a/samples/openapi3/client/petstore/ruby/docs/InlineObject5.md b/samples/client/petstore/ruby/docs/InlineObject5.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/InlineObject5.md rename to samples/client/petstore/ruby/docs/InlineObject5.md diff --git a/samples/openapi3/client/petstore/ruby/docs/InlineResponseDefault.md b/samples/client/petstore/ruby/docs/InlineResponseDefault.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/InlineResponseDefault.md rename to samples/client/petstore/ruby/docs/InlineResponseDefault.md diff --git a/samples/openapi3/client/petstore/ruby/docs/NullableClass.md b/samples/client/petstore/ruby/docs/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/NullableClass.md rename to samples/client/petstore/ruby/docs/NullableClass.md diff --git a/samples/openapi3/client/petstore/ruby/docs/OuterEnumDefaultValue.md b/samples/client/petstore/ruby/docs/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/OuterEnumDefaultValue.md rename to samples/client/petstore/ruby/docs/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/ruby/docs/OuterEnumInteger.md b/samples/client/petstore/ruby/docs/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/OuterEnumInteger.md rename to samples/client/petstore/ruby/docs/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/ruby/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/ruby/docs/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/ruby/docs/OuterEnumIntegerDefaultValue.md rename to samples/client/petstore/ruby/docs/OuterEnumIntegerDefaultValue.md diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index aa85e3e5bd24..6e650f534b1b 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description ## add_pet -> add_pet(body) +> add_pet(pet) Add a new pet to the store @@ -34,11 +34,11 @@ Petstore.configure do |config| end api_instance = Petstore::PetApi.new -body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store begin #Add a new pet to the store - api_instance.add_pet(body) + api_instance.add_pet(pet) rescue Petstore::ApiError => e puts "Exception when calling PetApi->add_pet: #{e}" end @@ -49,7 +49,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -278,7 +278,7 @@ Name | Type | Description | Notes ## update_pet -> update_pet(body) +> update_pet(pet) Update an existing pet @@ -294,11 +294,11 @@ Petstore.configure do |config| end api_instance = Petstore::PetApi.new -body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store begin #Update an existing pet - api_instance.update_pet(body) + api_instance.update_pet(pet) rescue Petstore::ApiError => e puts "Exception when calling PetApi->update_pet: #{e}" end @@ -309,7 +309,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 83cb89664a6b..ffbc1d04b1ef 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -156,7 +156,7 @@ No authorization required ## place_order -> Order place_order(body) +> Order place_order(order) Place an order for a pet @@ -167,11 +167,11 @@ Place an order for a pet require 'petstore' api_instance = Petstore::StoreApi.new -body = Petstore::Order.new # Order | order placed for purchasing the pet +order = Petstore::Order.new # Order | order placed for purchasing the pet begin #Place an order for a pet - result = api_instance.place_order(body) + result = api_instance.place_order(order) p result rescue Petstore::ApiError => e puts "Exception when calling StoreApi->place_order: #{e}" @@ -183,7 +183,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -195,6 +195,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/ruby/docs/TypeHolderDefault.md b/samples/client/petstore/ruby/docs/TypeHolderDefault.md deleted file mode 100644 index 5abe52ff5c5a..000000000000 --- a/samples/client/petstore/ruby/docs/TypeHolderDefault.md +++ /dev/null @@ -1,25 +0,0 @@ -# Petstore::TypeHolderDefault - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **String** | | [default to 'what'] -**number_item** | **Float** | | -**integer_item** | **Integer** | | -**bool_item** | **Boolean** | | [default to true] -**array_item** | **Array<Integer>** | | - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::TypeHolderDefault.new(string_item: null, - number_item: null, - integer_item: null, - bool_item: null, - array_item: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/TypeHolderExample.md b/samples/client/petstore/ruby/docs/TypeHolderExample.md deleted file mode 100644 index 2cab99f9bb7f..000000000000 --- a/samples/client/petstore/ruby/docs/TypeHolderExample.md +++ /dev/null @@ -1,27 +0,0 @@ -# Petstore::TypeHolderExample - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **String** | | -**number_item** | **Float** | | -**float_item** | **Float** | | -**integer_item** | **Integer** | | -**bool_item** | **Boolean** | | -**array_item** | **Array<Integer>** | | - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::TypeHolderExample.new(string_item: what, - number_item: 1.234, - float_item: 1.234, - integer_item: -2, - bool_item: true, - array_item: [0, 1, 2, 3]) -``` - - diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index 49a57ef58496..631a65ef1f19 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## create_user -> create_user(body) +> create_user(user) Create user @@ -30,11 +30,11 @@ This can only be done by the logged in user. require 'petstore' api_instance = Petstore::UserApi.new -body = Petstore::User.new # User | Created user object +user = Petstore::User.new # User | Created user object begin #Create user - api_instance.create_user(body) + api_instance.create_user(user) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_user: #{e}" end @@ -45,7 +45,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -57,13 +57,13 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined ## create_users_with_array_input -> create_users_with_array_input(body) +> create_users_with_array_input(user) Creates list of users with given input array @@ -74,11 +74,11 @@ Creates list of users with given input array require 'petstore' api_instance = Petstore::UserApi.new -body = [Petstore::User.new] # Array | List of user object +user = [Petstore::User.new] # Array | List of user object begin #Creates list of users with given input array - api_instance.create_users_with_array_input(body) + api_instance.create_users_with_array_input(user) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_users_with_array_input: #{e}" end @@ -89,7 +89,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Array<User>**](User.md)| List of user object | + **user** | [**Array<User>**](User.md)| List of user object | ### Return type @@ -101,13 +101,13 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined ## create_users_with_list_input -> create_users_with_list_input(body) +> create_users_with_list_input(user) Creates list of users with given input array @@ -118,11 +118,11 @@ Creates list of users with given input array require 'petstore' api_instance = Petstore::UserApi.new -body = [Petstore::User.new] # Array | List of user object +user = [Petstore::User.new] # Array | List of user object begin #Creates list of users with given input array - api_instance.create_users_with_list_input(body) + api_instance.create_users_with_list_input(user) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_users_with_list_input: #{e}" end @@ -133,7 +133,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Array<User>**](User.md)| List of user object | + **user** | [**Array<User>**](User.md)| List of user object | ### Return type @@ -145,7 +145,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined @@ -329,7 +329,7 @@ No authorization required ## update_user -> update_user(username, body) +> update_user(username, user) Updated user @@ -343,11 +343,11 @@ require 'petstore' api_instance = Petstore::UserApi.new username = 'username_example' # String | name that need to be deleted -body = Petstore::User.new # User | Updated user object +user = Petstore::User.new # User | Updated user object begin #Updated user - api_instance.update_user(username, body) + api_instance.update_user(username, user) rescue Petstore::ApiError => e puts "Exception when calling UserApi->update_user: #{e}" end @@ -359,7 +359,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -371,6 +371,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/ruby/docs/XmlItem.md b/samples/client/petstore/ruby/docs/XmlItem.md deleted file mode 100644 index 5520ae0c2bcd..000000000000 --- a/samples/client/petstore/ruby/docs/XmlItem.md +++ /dev/null @@ -1,73 +0,0 @@ -# Petstore::XmlItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attribute_string** | **String** | | [optional] -**attribute_number** | **Float** | | [optional] -**attribute_integer** | **Integer** | | [optional] -**attribute_boolean** | **Boolean** | | [optional] -**wrapped_array** | **Array<Integer>** | | [optional] -**name_string** | **String** | | [optional] -**name_number** | **Float** | | [optional] -**name_integer** | **Integer** | | [optional] -**name_boolean** | **Boolean** | | [optional] -**name_array** | **Array<Integer>** | | [optional] -**name_wrapped_array** | **Array<Integer>** | | [optional] -**prefix_string** | **String** | | [optional] -**prefix_number** | **Float** | | [optional] -**prefix_integer** | **Integer** | | [optional] -**prefix_boolean** | **Boolean** | | [optional] -**prefix_array** | **Array<Integer>** | | [optional] -**prefix_wrapped_array** | **Array<Integer>** | | [optional] -**namespace_string** | **String** | | [optional] -**namespace_number** | **Float** | | [optional] -**namespace_integer** | **Integer** | | [optional] -**namespace_boolean** | **Boolean** | | [optional] -**namespace_array** | **Array<Integer>** | | [optional] -**namespace_wrapped_array** | **Array<Integer>** | | [optional] -**prefix_ns_string** | **String** | | [optional] -**prefix_ns_number** | **Float** | | [optional] -**prefix_ns_integer** | **Integer** | | [optional] -**prefix_ns_boolean** | **Boolean** | | [optional] -**prefix_ns_array** | **Array<Integer>** | | [optional] -**prefix_ns_wrapped_array** | **Array<Integer>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::XmlItem.new(attribute_string: string, - attribute_number: 1.234, - attribute_integer: -2, - attribute_boolean: true, - wrapped_array: null, - name_string: string, - name_number: 1.234, - name_integer: -2, - name_boolean: true, - name_array: null, - name_wrapped_array: null, - prefix_string: string, - prefix_number: 1.234, - prefix_integer: -2, - prefix_boolean: true, - prefix_array: null, - prefix_wrapped_array: null, - namespace_string: string, - namespace_number: 1.234, - namespace_integer: -2, - namespace_boolean: true, - namespace_array: null, - namespace_wrapped_array: null, - prefix_ns_string: string, - prefix_ns_number: 1.234, - prefix_ns_integer: -2, - prefix_ns_boolean: true, - prefix_ns_array: null, - prefix_ns_wrapped_array: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/hello.txt b/samples/client/petstore/ruby/hello.txt similarity index 100% rename from samples/openapi3/client/petstore/ruby/hello.txt rename to samples/client/petstore/ruby/hello.txt diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index d02eecd4d328..7f8ae56e123b 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -17,21 +17,12 @@ require 'petstore/configuration' # Models -require 'petstore/models/additional_properties_any_type' -require 'petstore/models/additional_properties_array' -require 'petstore/models/additional_properties_boolean' require 'petstore/models/additional_properties_class' -require 'petstore/models/additional_properties_integer' -require 'petstore/models/additional_properties_number' -require 'petstore/models/additional_properties_object' -require 'petstore/models/additional_properties_string' require 'petstore/models/animal' require 'petstore/models/api_response' require 'petstore/models/array_of_array_of_number_only' require 'petstore/models/array_of_number_only' require 'petstore/models/array_test' -require 'petstore/models/big_cat' -require 'petstore/models/big_cat_all_of' require 'petstore/models/capitalization' require 'petstore/models/cat' require 'petstore/models/cat_all_of' @@ -45,29 +36,40 @@ require 'petstore/models/enum_test' require 'petstore/models/file' require 'petstore/models/file_schema_test_class' +require 'petstore/models/foo' require 'petstore/models/format_test' require 'petstore/models/has_only_read_only' +require 'petstore/models/health_check_result' +require 'petstore/models/inline_object' +require 'petstore/models/inline_object1' +require 'petstore/models/inline_object2' +require 'petstore/models/inline_object3' +require 'petstore/models/inline_object4' +require 'petstore/models/inline_object5' +require 'petstore/models/inline_response_default' require 'petstore/models/list' require 'petstore/models/map_test' require 'petstore/models/mixed_properties_and_additional_properties_class' require 'petstore/models/model200_response' require 'petstore/models/model_return' require 'petstore/models/name' +require 'petstore/models/nullable_class' require 'petstore/models/number_only' require 'petstore/models/order' require 'petstore/models/outer_composite' require 'petstore/models/outer_enum' +require 'petstore/models/outer_enum_default_value' +require 'petstore/models/outer_enum_integer' +require 'petstore/models/outer_enum_integer_default_value' require 'petstore/models/pet' require 'petstore/models/read_only_first' require 'petstore/models/special_model_name' require 'petstore/models/tag' -require 'petstore/models/type_holder_default' -require 'petstore/models/type_holder_example' require 'petstore/models/user' -require 'petstore/models/xml_item' # APIs require 'petstore/api/another_fake_api' +require 'petstore/api/default_api' require 'petstore/api/fake_api' require 'petstore/api/fake_classname_tags123_api' require 'petstore/api/pet_api' 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 bf8e6ebded57..dfa6972327d2 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 @@ -21,26 +21,26 @@ def initialize(api_client = ApiClient.default) end # To test special tags # To test special tags and operation ID starting with number - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def call_123_test_special_tags(body, opts = {}) - data, _status_code, _headers = call_123_test_special_tags_with_http_info(body, opts) + def call_123_test_special_tags(client, opts = {}) + data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts) data end # To test special tags # To test special tags and operation ID starting with number - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def call_123_test_special_tags_with_http_info(body, opts = {}) + def call_123_test_special_tags_with_http_info(client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AnotherFakeApi.call_123_test_special_tags" + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags" end # resource path local_var_path = '/another-fake/dummy' @@ -59,7 +59,7 @@ def call_123_test_special_tags_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(client) # return_type return_type = opts[:return_type] || 'Client' diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb rename to samples/client/petstore/ruby/lib/petstore/api/default_api.rb 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 ef91003dc4e8..3117e4bca528 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -19,51 +19,109 @@ class FakeApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # creates an XmlItem - # this route creates an XmlItem - # @param xml_item [XmlItem] XmlItem Body + # Health check endpoint # @param [Hash] opts the optional parameters + # @return [HealthCheckResult] + def fake_health_get(opts = {}) + data, _status_code, _headers = fake_health_get_with_http_info(opts) + data + end + + # Health check endpoint + # @param [Hash] opts the optional parameters + # @return [Array<(HealthCheckResult, Integer, Hash)>] HealthCheckResult data, response status code and response headers + def fake_health_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_health_get ...' + end + # resource path + local_var_path = '/fake/health' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HealthCheckResult' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # test http signature authentication + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter # @return [nil] - def create_xml_item(xml_item, opts = {}) - create_xml_item_with_http_info(xml_item, opts) + def fake_http_signature_test(pet, opts = {}) + fake_http_signature_test_with_http_info(pet, opts) nil end - # creates an XmlItem - # this route creates an XmlItem - # @param xml_item [XmlItem] XmlItem Body + # test http signature authentication + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_xml_item_with_http_info(xml_item, opts = {}) + def fake_http_signature_test_with_http_info(pet, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.create_xml_item ...' + @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' end - # verify the required parameter 'xml_item' is set - if @api_client.config.client_side_validation && xml_item.nil? - fail ArgumentError, "Missing the required parameter 'xml_item' when calling FakeApi.create_xml_item" + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" end # resource path - local_var_path = '/fake/create_xml_item' + local_var_path = '/fake/http-signature-test' # query parameters query_params = opts[:query_params] || {} + query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) + header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(xml_item) + post_body = opts[:body] || @api_client.object_to_http_body(pet) # return_type return_type = opts[:return_type] # auth_names - auth_names = opts[:auth_names] || [] + auth_names = opts[:auth_names] || ['http_signature_test'] new_options = opts.merge( :header_params => header_params, @@ -74,9 +132,9 @@ def create_xml_item_with_http_info(xml_item, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#create_xml_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -108,6 +166,8 @@ def fake_outer_boolean_serialize_with_http_info(opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -139,7 +199,7 @@ def fake_outer_boolean_serialize_with_http_info(opts = {}) # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :body Input composite as post body + # @option opts [OuterComposite] :outer_composite Input composite as post body # @return [OuterComposite] def fake_outer_composite_serialize(opts = {}) data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) @@ -148,7 +208,7 @@ def fake_outer_composite_serialize(opts = {}) # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :body Input composite as post body + # @option opts [OuterComposite] :outer_composite Input composite as post body # @return [Array<(OuterComposite, Integer, Hash)>] OuterComposite data, response status code and response headers def fake_outer_composite_serialize_with_http_info(opts = {}) if @api_client.config.debugging @@ -164,12 +224,14 @@ def fake_outer_composite_serialize_with_http_info(opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'outer_composite']) # return_type return_type = opts[:return_type] || 'OuterComposite' @@ -220,6 +282,8 @@ def fake_outer_number_serialize_with_http_info(opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -276,6 +340,8 @@ def fake_outer_string_serialize_with_http_info(opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -306,25 +372,25 @@ def fake_outer_string_serialize_with_http_info(opts = {}) end # For this test, the body for this request much reference a schema named `File`. - # @param body [FileSchemaTestClass] + # @param file_schema_test_class [FileSchemaTestClass] # @param [Hash] opts the optional parameters # @return [nil] - def test_body_with_file_schema(body, opts = {}) - test_body_with_file_schema_with_http_info(body, opts) + def test_body_with_file_schema(file_schema_test_class, opts = {}) + test_body_with_file_schema_with_http_info(file_schema_test_class, opts) nil end # For this test, the body for this request much reference a schema named `File`. - # @param body [FileSchemaTestClass] + # @param file_schema_test_class [FileSchemaTestClass] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_body_with_file_schema_with_http_info(body, opts = {}) + def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_body_with_file_schema" + # verify the required parameter 'file_schema_test_class' is set + if @api_client.config.client_side_validation && file_schema_test_class.nil? + fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema" end # resource path local_var_path = '/fake/body-with-file-schema' @@ -341,7 +407,7 @@ def test_body_with_file_schema_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(file_schema_test_class) # return_type return_type = opts[:return_type] @@ -366,19 +432,19 @@ def test_body_with_file_schema_with_http_info(body, opts = {}) end # @param query [String] - # @param body [User] + # @param user [User] # @param [Hash] opts the optional parameters # @return [nil] - def test_body_with_query_params(query, body, opts = {}) - test_body_with_query_params_with_http_info(query, body, opts) + def test_body_with_query_params(query, user, opts = {}) + test_body_with_query_params_with_http_info(query, user, opts) nil end # @param query [String] - # @param body [User] + # @param user [User] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_body_with_query_params_with_http_info(query, body, opts = {}) + def test_body_with_query_params_with_http_info(query, user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...' end @@ -386,9 +452,9 @@ def test_body_with_query_params_with_http_info(query, body, opts = {}) if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params" end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_body_with_query_params" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params" end # resource path local_var_path = '/fake/body-with-query-params' @@ -406,7 +472,7 @@ def test_body_with_query_params_with_http_info(query, body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] @@ -432,26 +498,26 @@ def test_body_with_query_params_with_http_info(query, body, opts = {}) # To test \"client\" model # To test \"client\" model - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def test_client_model(body, opts = {}) - data, _status_code, _headers = test_client_model_with_http_info(body, opts) + def test_client_model(client, opts = {}) + data, _status_code, _headers = test_client_model_with_http_info(client, opts) data end # To test \"client\" model # To test \"client\" model - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def test_client_model_with_http_info(body, opts = {}) + def test_client_model_with_http_info(client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_client_model" + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model" end # resource path local_var_path = '/fake' @@ -470,7 +536,7 @@ def test_client_model_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(client) # return_type return_type = opts[:return_type] || 'Client' @@ -494,8 +560,8 @@ def test_client_model_with_http_info(body, opts = {}) return data, status_code, headers end - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # @param number [Float] None # @param double [Float] None # @param pattern_without_delimiter [String] None @@ -517,8 +583,8 @@ def test_endpoint_parameters(number, double, pattern_without_delimiter, byte, op nil end - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # @param number [Float] None # @param double [Float] None # @param pattern_without_delimiter [String] None @@ -732,7 +798,7 @@ def test_enum_parameters_with_http_info(opts = {}) # query parameters query_params = opts[:query_params] || {} - query_params[:'enum_query_string_array'] = @api_client.build_collection_param(opts[:'enum_query_string_array'], :csv) if !opts[:'enum_query_string_array'].nil? + query_params[:'enum_query_string_array'] = @api_client.build_collection_param(opts[:'enum_query_string_array'], :multi) if !opts[:'enum_query_string_array'].nil? query_params[:'enum_query_string'] = opts[:'enum_query_string'] if !opts[:'enum_query_string'].nil? query_params[:'enum_query_integer'] = opts[:'enum_query_integer'] if !opts[:'enum_query_integer'].nil? query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil? @@ -840,7 +906,7 @@ def test_group_parameters_with_http_info(required_string_group, required_boolean return_type = opts[:return_type] # auth_names - auth_names = opts[:auth_names] || [] + auth_names = opts[:auth_names] || ['bearer_test'] new_options = opts.merge( :header_params => header_params, @@ -859,25 +925,25 @@ def test_group_parameters_with_http_info(required_string_group, required_boolean end # test inline additionalProperties - # @param param [Hash] request body + # @param request_body [Hash] request body # @param [Hash] opts the optional parameters # @return [nil] - def test_inline_additional_properties(param, opts = {}) - test_inline_additional_properties_with_http_info(param, opts) + def test_inline_additional_properties(request_body, opts = {}) + test_inline_additional_properties_with_http_info(request_body, opts) nil end # test inline additionalProperties - # @param param [Hash] request body + # @param request_body [Hash] request body # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_inline_additional_properties_with_http_info(param, opts = {}) + def test_inline_additional_properties_with_http_info(request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...' 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_inline_additional_properties" + # verify the required parameter 'request_body' is set + if @api_client.config.client_side_validation && request_body.nil? + fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties" end # resource path local_var_path = '/fake/inline-additionalProperties' @@ -894,7 +960,7 @@ def test_inline_additional_properties_with_http_info(param, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(param) + post_body = opts[:body] || @api_client.object_to_http_body(request_body) # return_type return_type = opts[:return_type] @@ -1036,7 +1102,7 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur # query parameters query_params = opts[:query_params] || {} - query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :multi) query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) query_params[:'http'] = @api_client.build_collection_param(http, :space) query_params[:'url'] = @api_client.build_collection_param(url, :csv) 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 b266f0977478..1e44496d5f82 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 @@ -21,26 +21,26 @@ def initialize(api_client = ApiClient.default) end # To test class name in snake case # To test class name in snake case - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def test_classname(body, opts = {}) - data, _status_code, _headers = test_classname_with_http_info(body, opts) + def test_classname(client, opts = {}) + data, _status_code, _headers = test_classname_with_http_info(client, opts) data end # To test class name in snake case # To test class name in snake case - # @param body [Client] client model + # @param client [Client] client model # @param [Hash] opts the optional parameters # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def test_classname_with_http_info(body, opts = {}) + def test_classname_with_http_info(client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FakeClassnameTags123Api.test_classname" + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname" end # resource path local_var_path = '/fake_classname_test' @@ -59,7 +59,7 @@ def test_classname_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(client) # return_type return_type = opts[:return_type] || 'Client' 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 1f6c48a31cdc..4858424f2a05 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -20,25 +20,25 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Add a new pet to the store - # @param body [Pet] Pet object that needs to be added to the store + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] - def add_pet(body, opts = {}) - add_pet_with_http_info(body, opts) + def add_pet(pet, opts = {}) + add_pet_with_http_info(pet, opts) nil end # Add a new pet to the store - # @param body [Pet] Pet object that needs to be added to the store + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def add_pet_with_http_info(body, opts = {}) + def add_pet_with_http_info(pet, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.add_pet" + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet" end # resource path local_var_path = '/pet' @@ -55,7 +55,7 @@ def add_pet_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(pet) # return_type return_type = opts[:return_type] @@ -329,25 +329,25 @@ def get_pet_by_id_with_http_info(pet_id, opts = {}) end # Update an existing pet - # @param body [Pet] Pet object that needs to be added to the store + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] - def update_pet(body, opts = {}) - update_pet_with_http_info(body, opts) + def update_pet(pet, opts = {}) + update_pet_with_http_info(pet, opts) nil end # Update an existing pet - # @param body [Pet] Pet object that needs to be added to the store + # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_pet_with_http_info(body, opts = {}) + def update_pet_with_http_info(pet, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.update_pet" + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet" end # resource path local_var_path = '/pet' @@ -364,7 +364,7 @@ def update_pet_with_http_info(body, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(pet) # return_type return_type = opts[:return_type] 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 5e510a6c7e04..dc4952419a12 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -206,25 +206,25 @@ def get_order_by_id_with_http_info(order_id, opts = {}) end # Place an order for a pet - # @param body [Order] order placed for purchasing the pet + # @param order [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] - def place_order(body, opts = {}) - data, _status_code, _headers = place_order_with_http_info(body, opts) + def place_order(order, opts = {}) + data, _status_code, _headers = place_order_with_http_info(order, opts) data end # Place an order for a pet - # @param body [Order] order placed for purchasing the pet + # @param order [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers - def place_order_with_http_info(body, opts = {}) + def place_order_with_http_info(order, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling StoreApi.place_order" + # verify the required parameter 'order' is set + if @api_client.config.client_side_validation && order.nil? + fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order" end # resource path local_var_path = '/store/order' @@ -236,12 +236,14 @@ def place_order_with_http_info(body, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(order) # return_type return_type = opts[:return_type] || 'Order' 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 30d0aff9129c..b2fbf6be7c65 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -21,26 +21,26 @@ def initialize(api_client = ApiClient.default) end # Create user # This can only be done by the logged in user. - # @param body [User] Created user object + # @param user [User] Created user object # @param [Hash] opts the optional parameters # @return [nil] - def create_user(body, opts = {}) - create_user_with_http_info(body, opts) + def create_user(user, opts = {}) + create_user_with_http_info(user, opts) nil end # Create user # This can only be done by the logged in user. - # @param body [User] Created user object + # @param user [User] Created user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_user_with_http_info(body, opts = {}) + def create_user_with_http_info(user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_user ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_user" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user" end # resource path local_var_path = '/user' @@ -50,12 +50,14 @@ def create_user_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] @@ -80,25 +82,25 @@ def create_user_with_http_info(body, opts = {}) end # Creates list of users with given input array - # @param body [Array] List of user object + # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] - def create_users_with_array_input(body, opts = {}) - create_users_with_array_input_with_http_info(body, opts) + def create_users_with_array_input(user, opts = {}) + create_users_with_array_input_with_http_info(user, opts) nil end # Creates list of users with given input array - # @param body [Array] List of user object + # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_users_with_array_input_with_http_info(body, opts = {}) + def create_users_with_array_input_with_http_info(user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_array_input" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input" end # resource path local_var_path = '/user/createWithArray' @@ -108,12 +110,14 @@ def create_users_with_array_input_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] @@ -138,25 +142,25 @@ def create_users_with_array_input_with_http_info(body, opts = {}) end # Creates list of users with given input array - # @param body [Array] List of user object + # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] - def create_users_with_list_input(body, opts = {}) - create_users_with_list_input_with_http_info(body, opts) + def create_users_with_list_input(user, opts = {}) + create_users_with_list_input_with_http_info(user, opts) nil end # Creates list of users with given input array - # @param body [Array] List of user object + # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_users_with_list_input_with_http_info(body, opts = {}) + def create_users_with_list_input_with_http_info(user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_list_input" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input" end # resource path local_var_path = '/user/createWithList' @@ -166,12 +170,14 @@ def create_users_with_list_input_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] @@ -438,21 +444,21 @@ def logout_user_with_http_info(opts = {}) # Updated user # This can only be done by the logged in user. # @param username [String] name that need to be deleted - # @param body [User] Updated user object + # @param user [User] Updated user object # @param [Hash] opts the optional parameters # @return [nil] - def update_user(username, body, opts = {}) - update_user_with_http_info(username, body, opts) + def update_user(username, user, opts = {}) + update_user_with_http_info(username, user, opts) nil end # Updated user # This can only be done by the logged in user. # @param username [String] name that need to be deleted - # @param body [User] Updated user object + # @param user [User] Updated user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_user_with_http_info(username, body, opts = {}) + def update_user_with_http_info(username, user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.update_user ...' end @@ -460,9 +466,9 @@ def update_user_with_http_info(username, body, opts = {}) if @api_client.config.client_side_validation && username.nil? fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user" end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.update_user" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" end # resource path local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) @@ -472,12 +478,14 @@ def update_user_with_http_info(username, body, opts = {}) # header parameters header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) + post_body = opts[:body] || @api_client.object_to_http_body(user) # return_type return_type = opts[:return_type] diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 41055835ceed..75e3e441f4fb 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -207,6 +207,14 @@ def auth_settings key: 'api_key_query', value: api_key_with_prefix('api_key_query') }, + 'bearer_test' => + { + type: 'bearer', + in: 'header', + format: 'JWT', + key: 'Authorization', + value: "Bearer #{access_token}" + }, 'http_basic_test' => { type: 'basic', @@ -228,8 +236,41 @@ def auth_settings def server_settings [ { - url: "http://petstore.swagger.io:80/v2", - description: "No description provided", + url: "http://{server}.swagger.io:{port}/v2", + description: "petstore server", + variables: { + server: { + description: "No description provided", + default_value: "petstore", + enum_values: [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + port: { + description: "No description provided", + default_value: "80", + enum_values: [ + "80", + "8080" + ] + } + } + }, + { + url: "https://localhost:8080/{version}", + description: "The local server", + variables: { + version: { + description: "No description provided", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } } ] end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb deleted file mode 100644 index 9d69317eab1a..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesAnyType - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesAnyType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesAnyType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb deleted file mode 100644 index 75afda54eeed..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesArray - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesArray` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesArray`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb deleted file mode 100644 index 3087eae37aef..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesBoolean - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesBoolean` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesBoolean`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -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 ff8841189f78..2e353ef8e464 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 @@ -14,59 +14,23 @@ module Petstore class AdditionalPropertiesClass - attr_accessor :map_string + attr_accessor :map_property - attr_accessor :map_number - - attr_accessor :map_integer - - attr_accessor :map_boolean - - attr_accessor :map_array_integer - - attr_accessor :map_array_anytype - - attr_accessor :map_map_string - - attr_accessor :map_map_anytype - - attr_accessor :anytype_1 - - attr_accessor :anytype_2 - - attr_accessor :anytype_3 + attr_accessor :map_of_map_property # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'map_string' => :'map_string', - :'map_number' => :'map_number', - :'map_integer' => :'map_integer', - :'map_boolean' => :'map_boolean', - :'map_array_integer' => :'map_array_integer', - :'map_array_anytype' => :'map_array_anytype', - :'map_map_string' => :'map_map_string', - :'map_map_anytype' => :'map_map_anytype', - :'anytype_1' => :'anytype_1', - :'anytype_2' => :'anytype_2', - :'anytype_3' => :'anytype_3' + :'map_property' => :'map_property', + :'map_of_map_property' => :'map_of_map_property' } end # Attribute type mapping. def self.openapi_types { - :'map_string' => :'Hash', - :'map_number' => :'Hash', - :'map_integer' => :'Hash', - :'map_boolean' => :'Hash', - :'map_array_integer' => :'Hash>', - :'map_array_anytype' => :'Hash>', - :'map_map_string' => :'Hash>', - :'map_map_anytype' => :'Hash>', - :'anytype_1' => :'Object', - :'anytype_2' => :'Object', - :'anytype_3' => :'Object' + :'map_property' => :'Hash', + :'map_of_map_property' => :'Hash>' } end @@ -91,65 +55,17 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'map_string') - if (value = attributes[:'map_string']).is_a?(Hash) - self.map_string = value + if attributes.key?(:'map_property') + if (value = attributes[:'map_property']).is_a?(Hash) + self.map_property = value end end - if attributes.key?(:'map_number') - if (value = attributes[:'map_number']).is_a?(Hash) - self.map_number = value + if attributes.key?(:'map_of_map_property') + if (value = attributes[:'map_of_map_property']).is_a?(Hash) + self.map_of_map_property = value end end - - if attributes.key?(:'map_integer') - if (value = attributes[:'map_integer']).is_a?(Hash) - self.map_integer = value - end - end - - if attributes.key?(:'map_boolean') - if (value = attributes[:'map_boolean']).is_a?(Hash) - self.map_boolean = value - end - end - - if attributes.key?(:'map_array_integer') - if (value = attributes[:'map_array_integer']).is_a?(Hash) - self.map_array_integer = value - end - end - - if attributes.key?(:'map_array_anytype') - if (value = attributes[:'map_array_anytype']).is_a?(Hash) - self.map_array_anytype = value - end - end - - if attributes.key?(:'map_map_string') - if (value = attributes[:'map_map_string']).is_a?(Hash) - self.map_map_string = value - end - end - - if attributes.key?(:'map_map_anytype') - if (value = attributes[:'map_map_anytype']).is_a?(Hash) - self.map_map_anytype = value - end - end - - if attributes.key?(:'anytype_1') - self.anytype_1 = attributes[:'anytype_1'] - end - - if attributes.key?(:'anytype_2') - self.anytype_2 = attributes[:'anytype_2'] - end - - if attributes.key?(:'anytype_3') - self.anytype_3 = attributes[:'anytype_3'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -170,17 +86,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - map_string == o.map_string && - map_number == o.map_number && - map_integer == o.map_integer && - map_boolean == o.map_boolean && - map_array_integer == o.map_array_integer && - map_array_anytype == o.map_array_anytype && - map_map_string == o.map_map_string && - map_map_anytype == o.map_map_anytype && - anytype_1 == o.anytype_1 && - anytype_2 == o.anytype_2 && - anytype_3 == o.anytype_3 + map_property == o.map_property && + map_of_map_property == o.map_of_map_property end # @see the `==` method @@ -192,7 +99,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [map_string, map_number, map_integer, map_boolean, map_array_integer, map_array_anytype, map_map_string, map_map_anytype, anytype_1, anytype_2, anytype_3].hash + [map_property, map_of_map_property].hash end # Builds the object from hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb deleted file mode 100644 index 62d680fc49c0..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesInteger - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesInteger` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesInteger`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb deleted file mode 100644 index d218e5673a0b..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesNumber - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb deleted file mode 100644 index d0dc9d7e48d6..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesObject - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb deleted file mode 100644 index 22627845e37b..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesString - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesString` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesString`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb b/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb deleted file mode 100644 index 9be82c414ced..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class BigCat < Cat - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'BigCatAllOf', - :'Cat' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCat` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true && super - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb deleted file mode 100644 index 36b824ea4520..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class BigCatAllOf - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCatAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - 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 b1faea6d4a6f..473d7994ad6d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -24,6 +24,12 @@ class EnumTest attr_accessor :outer_enum + attr_accessor :outer_enum_integer + + attr_accessor :outer_enum_default_value + + attr_accessor :outer_enum_integer_default_value + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -53,7 +59,10 @@ def self.attribute_map :'enum_string_required' => :'enum_string_required', :'enum_integer' => :'enum_integer', :'enum_number' => :'enum_number', - :'outer_enum' => :'outerEnum' + :'outer_enum' => :'outerEnum', + :'outer_enum_integer' => :'outerEnumInteger', + :'outer_enum_default_value' => :'outerEnumDefaultValue', + :'outer_enum_integer_default_value' => :'outerEnumIntegerDefaultValue' } end @@ -64,13 +73,17 @@ def self.openapi_types :'enum_string_required' => :'String', :'enum_integer' => :'Integer', :'enum_number' => :'Float', - :'outer_enum' => :'OuterEnum' + :'outer_enum' => :'OuterEnum', + :'outer_enum_integer' => :'OuterEnumInteger', + :'outer_enum_default_value' => :'OuterEnumDefaultValue', + :'outer_enum_integer_default_value' => :'OuterEnumIntegerDefaultValue' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'outer_enum', ]) end @@ -108,6 +121,18 @@ def initialize(attributes = {}) if attributes.key?(:'outer_enum') self.outer_enum = attributes[:'outer_enum'] end + + if attributes.key?(:'outer_enum_integer') + self.outer_enum_integer = attributes[:'outer_enum_integer'] + end + + if attributes.key?(:'outer_enum_default_value') + self.outer_enum_default_value = attributes[:'outer_enum_default_value'] + end + + if attributes.key?(:'outer_enum_integer_default_value') + self.outer_enum_integer_default_value = attributes[:'outer_enum_integer_default_value'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -185,7 +210,10 @@ def ==(o) enum_string_required == o.enum_string_required && enum_integer == o.enum_integer && enum_number == o.enum_number && - outer_enum == o.outer_enum + outer_enum == o.outer_enum && + outer_enum_integer == o.outer_enum_integer && + outer_enum_default_value == o.outer_enum_default_value && + outer_enum_integer_default_value == o.outer_enum_integer_default_value end # @see the `==` method @@ -197,7 +225,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [enum_string, enum_string_required, enum_integer, enum_number, outer_enum].hash + [enum_string, enum_string_required, enum_integer, enum_number, outer_enum, outer_enum_integer, outer_enum_default_value, outer_enum_integer_default_value].hash end # Builds the object from hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/client/petstore/ruby/lib/petstore/models/foo.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb rename to samples/client/petstore/ruby/lib/petstore/models/foo.rb 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 170955b07f30..d39e9c915806 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -40,7 +40,11 @@ class FormatTest attr_accessor :password - attr_accessor :big_decimal + # A string that is a 10 digit number. Can have leading zeros. + attr_accessor :pattern_with_digits + + # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + attr_accessor :pattern_with_digits_and_delimiter # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map @@ -58,7 +62,8 @@ def self.attribute_map :'date_time' => :'dateTime', :'uuid' => :'uuid', :'password' => :'password', - :'big_decimal' => :'BigDecimal' + :'pattern_with_digits' => :'pattern_with_digits', + :'pattern_with_digits_and_delimiter' => :'pattern_with_digits_and_delimiter' } end @@ -78,7 +83,8 @@ def self.openapi_types :'date_time' => :'DateTime', :'uuid' => :'String', :'password' => :'String', - :'big_decimal' => :'BigDecimal' + :'pattern_with_digits' => :'String', + :'pattern_with_digits_and_delimiter' => :'String' } end @@ -155,8 +161,12 @@ def initialize(attributes = {}) self.password = attributes[:'password'] end - if attributes.key?(:'big_decimal') - self.big_decimal = attributes[:'big_decimal'] + if attributes.key?(:'pattern_with_digits') + self.pattern_with_digits = attributes[:'pattern_with_digits'] + end + + if attributes.key?(:'pattern_with_digits_and_delimiter') + self.pattern_with_digits_and_delimiter = attributes[:'pattern_with_digits_and_delimiter'] end end @@ -217,11 +227,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "byte", byte cannot be nil.') end - pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) - if @byte !~ pattern - invalid_properties.push("invalid value for \"byte\", must conform to the pattern #{pattern}.") - end - if @date.nil? invalid_properties.push('invalid value for "date", date cannot be nil.') end @@ -238,6 +243,16 @@ def list_invalid_properties invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') end + pattern = Regexp.new(/^\d{10}$/) + if !@pattern_with_digits.nil? && @pattern_with_digits !~ pattern + invalid_properties.push("invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}.") + end + + pattern = Regexp.new(/^image_\d{1,3}$/i) + if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ pattern + invalid_properties.push("invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}.") + end + invalid_properties end @@ -257,11 +272,12 @@ def valid? return false if !@double.nil? && @double < 67.8 return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) return false if @byte.nil? - return false if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) return false if @date.nil? return false if @password.nil? return false if @password.to_s.length > 64 return false if @password.to_s.length < 10 + return false if !@pattern_with_digits.nil? && @pattern_with_digits !~ Regexp.new(/^\d{10}$/) + return false if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ Regexp.new(/^image_\d{1,3}$/i) true end @@ -350,21 +366,6 @@ def string=(string) @string = string end - # Custom attribute writer method with validation - # @param [Object] byte Value to be assigned - def byte=(byte) - if byte.nil? - fail ArgumentError, 'byte cannot be nil' - end - - pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) - if byte !~ pattern - fail ArgumentError, "invalid value for \"byte\", must conform to the pattern #{pattern}." - end - - @byte = byte - end - # Custom attribute writer method with validation # @param [Object] password Value to be assigned def password=(password) @@ -383,6 +384,28 @@ def password=(password) @password = password end + # Custom attribute writer method with validation + # @param [Object] pattern_with_digits Value to be assigned + def pattern_with_digits=(pattern_with_digits) + pattern = Regexp.new(/^\d{10}$/) + if !pattern_with_digits.nil? && pattern_with_digits !~ pattern + fail ArgumentError, "invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}." + end + + @pattern_with_digits = pattern_with_digits + end + + # Custom attribute writer method with validation + # @param [Object] pattern_with_digits_and_delimiter Value to be assigned + def pattern_with_digits_and_delimiter=(pattern_with_digits_and_delimiter) + pattern = Regexp.new(/^image_\d{1,3}$/i) + if !pattern_with_digits_and_delimiter.nil? && pattern_with_digits_and_delimiter !~ pattern + fail ArgumentError, "invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}." + end + + @pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -401,7 +424,8 @@ def ==(o) date_time == o.date_time && uuid == o.uuid && password == o.password && - big_decimal == o.big_decimal + pattern_with_digits == o.pattern_with_digits && + pattern_with_digits_and_delimiter == o.pattern_with_digits_and_delimiter end # @see the `==` method @@ -413,7 +437,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, big_decimal].hash + [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash end # Builds the object from hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb rename to samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb rename to samples/client/petstore/ruby/lib/petstore/models/inline_object.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb rename to samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb rename to samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb rename to samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb rename to samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb rename to samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb rename to samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb rename to samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb rename to samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb rename to samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb rename to samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb diff --git a/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb deleted file mode 100644 index 4a3e8428f95d..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class TypeHolderDefault - attr_accessor :string_item - - attr_accessor :number_item - - attr_accessor :integer_item - - attr_accessor :bool_item - - attr_accessor :array_item - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'string_item' => :'string_item', - :'number_item' => :'number_item', - :'integer_item' => :'integer_item', - :'bool_item' => :'bool_item', - :'array_item' => :'array_item' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'string_item' => :'String', - :'number_item' => :'Float', - :'integer_item' => :'Integer', - :'bool_item' => :'Boolean', - :'array_item' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::TypeHolderDefault` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TypeHolderDefault`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'string_item') - self.string_item = attributes[:'string_item'] - else - self.string_item = 'what' - end - - if attributes.key?(:'number_item') - self.number_item = attributes[:'number_item'] - end - - if attributes.key?(:'integer_item') - self.integer_item = attributes[:'integer_item'] - end - - if attributes.key?(:'bool_item') - self.bool_item = attributes[:'bool_item'] - else - self.bool_item = true - end - - if attributes.key?(:'array_item') - if (value = attributes[:'array_item']).is_a?(Array) - self.array_item = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @string_item.nil? - invalid_properties.push('invalid value for "string_item", string_item cannot be nil.') - end - - if @number_item.nil? - invalid_properties.push('invalid value for "number_item", number_item cannot be nil.') - end - - if @integer_item.nil? - invalid_properties.push('invalid value for "integer_item", integer_item cannot be nil.') - end - - if @bool_item.nil? - invalid_properties.push('invalid value for "bool_item", bool_item cannot be nil.') - end - - if @array_item.nil? - invalid_properties.push('invalid value for "array_item", array_item cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @string_item.nil? - return false if @number_item.nil? - return false if @integer_item.nil? - return false if @bool_item.nil? - return false if @array_item.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - string_item == o.string_item && - number_item == o.number_item && - integer_item == o.integer_item && - bool_item == o.bool_item && - array_item == o.array_item - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [string_item, number_item, integer_item, bool_item, array_item].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb deleted file mode 100644 index b3aac77c4528..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class TypeHolderExample - attr_accessor :string_item - - attr_accessor :number_item - - attr_accessor :float_item - - attr_accessor :integer_item - - attr_accessor :bool_item - - attr_accessor :array_item - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'string_item' => :'string_item', - :'number_item' => :'number_item', - :'float_item' => :'float_item', - :'integer_item' => :'integer_item', - :'bool_item' => :'bool_item', - :'array_item' => :'array_item' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'string_item' => :'String', - :'number_item' => :'Float', - :'float_item' => :'Float', - :'integer_item' => :'Integer', - :'bool_item' => :'Boolean', - :'array_item' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::TypeHolderExample` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TypeHolderExample`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'string_item') - self.string_item = attributes[:'string_item'] - end - - if attributes.key?(:'number_item') - self.number_item = attributes[:'number_item'] - end - - if attributes.key?(:'float_item') - self.float_item = attributes[:'float_item'] - end - - if attributes.key?(:'integer_item') - self.integer_item = attributes[:'integer_item'] - end - - if attributes.key?(:'bool_item') - self.bool_item = attributes[:'bool_item'] - end - - if attributes.key?(:'array_item') - if (value = attributes[:'array_item']).is_a?(Array) - self.array_item = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @string_item.nil? - invalid_properties.push('invalid value for "string_item", string_item cannot be nil.') - end - - if @number_item.nil? - invalid_properties.push('invalid value for "number_item", number_item cannot be nil.') - end - - if @float_item.nil? - invalid_properties.push('invalid value for "float_item", float_item cannot be nil.') - end - - if @integer_item.nil? - invalid_properties.push('invalid value for "integer_item", integer_item cannot be nil.') - end - - if @bool_item.nil? - invalid_properties.push('invalid value for "bool_item", bool_item cannot be nil.') - end - - if @array_item.nil? - invalid_properties.push('invalid value for "array_item", array_item cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @string_item.nil? - return false if @number_item.nil? - return false if @float_item.nil? - return false if @integer_item.nil? - return false if @bool_item.nil? - return false if @array_item.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - string_item == o.string_item && - number_item == o.number_item && - float_item == o.float_item && - integer_item == o.integer_item && - bool_item == o.bool_item && - array_item == o.array_item - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [string_item, number_item, float_item, integer_item, bool_item, array_item].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb deleted file mode 100644 index f9ff5c6e27bb..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb +++ /dev/null @@ -1,476 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class XmlItem - attr_accessor :attribute_string - - attr_accessor :attribute_number - - attr_accessor :attribute_integer - - attr_accessor :attribute_boolean - - attr_accessor :wrapped_array - - attr_accessor :name_string - - attr_accessor :name_number - - attr_accessor :name_integer - - attr_accessor :name_boolean - - attr_accessor :name_array - - attr_accessor :name_wrapped_array - - attr_accessor :prefix_string - - attr_accessor :prefix_number - - attr_accessor :prefix_integer - - attr_accessor :prefix_boolean - - attr_accessor :prefix_array - - attr_accessor :prefix_wrapped_array - - attr_accessor :namespace_string - - attr_accessor :namespace_number - - attr_accessor :namespace_integer - - attr_accessor :namespace_boolean - - attr_accessor :namespace_array - - attr_accessor :namespace_wrapped_array - - attr_accessor :prefix_ns_string - - attr_accessor :prefix_ns_number - - attr_accessor :prefix_ns_integer - - attr_accessor :prefix_ns_boolean - - attr_accessor :prefix_ns_array - - attr_accessor :prefix_ns_wrapped_array - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attribute_string' => :'attribute_string', - :'attribute_number' => :'attribute_number', - :'attribute_integer' => :'attribute_integer', - :'attribute_boolean' => :'attribute_boolean', - :'wrapped_array' => :'wrapped_array', - :'name_string' => :'name_string', - :'name_number' => :'name_number', - :'name_integer' => :'name_integer', - :'name_boolean' => :'name_boolean', - :'name_array' => :'name_array', - :'name_wrapped_array' => :'name_wrapped_array', - :'prefix_string' => :'prefix_string', - :'prefix_number' => :'prefix_number', - :'prefix_integer' => :'prefix_integer', - :'prefix_boolean' => :'prefix_boolean', - :'prefix_array' => :'prefix_array', - :'prefix_wrapped_array' => :'prefix_wrapped_array', - :'namespace_string' => :'namespace_string', - :'namespace_number' => :'namespace_number', - :'namespace_integer' => :'namespace_integer', - :'namespace_boolean' => :'namespace_boolean', - :'namespace_array' => :'namespace_array', - :'namespace_wrapped_array' => :'namespace_wrapped_array', - :'prefix_ns_string' => :'prefix_ns_string', - :'prefix_ns_number' => :'prefix_ns_number', - :'prefix_ns_integer' => :'prefix_ns_integer', - :'prefix_ns_boolean' => :'prefix_ns_boolean', - :'prefix_ns_array' => :'prefix_ns_array', - :'prefix_ns_wrapped_array' => :'prefix_ns_wrapped_array' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attribute_string' => :'String', - :'attribute_number' => :'Float', - :'attribute_integer' => :'Integer', - :'attribute_boolean' => :'Boolean', - :'wrapped_array' => :'Array', - :'name_string' => :'String', - :'name_number' => :'Float', - :'name_integer' => :'Integer', - :'name_boolean' => :'Boolean', - :'name_array' => :'Array', - :'name_wrapped_array' => :'Array', - :'prefix_string' => :'String', - :'prefix_number' => :'Float', - :'prefix_integer' => :'Integer', - :'prefix_boolean' => :'Boolean', - :'prefix_array' => :'Array', - :'prefix_wrapped_array' => :'Array', - :'namespace_string' => :'String', - :'namespace_number' => :'Float', - :'namespace_integer' => :'Integer', - :'namespace_boolean' => :'Boolean', - :'namespace_array' => :'Array', - :'namespace_wrapped_array' => :'Array', - :'prefix_ns_string' => :'String', - :'prefix_ns_number' => :'Float', - :'prefix_ns_integer' => :'Integer', - :'prefix_ns_boolean' => :'Boolean', - :'prefix_ns_array' => :'Array', - :'prefix_ns_wrapped_array' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::XmlItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::XmlItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attribute_string') - self.attribute_string = attributes[:'attribute_string'] - end - - if attributes.key?(:'attribute_number') - self.attribute_number = attributes[:'attribute_number'] - end - - if attributes.key?(:'attribute_integer') - self.attribute_integer = attributes[:'attribute_integer'] - end - - if attributes.key?(:'attribute_boolean') - self.attribute_boolean = attributes[:'attribute_boolean'] - end - - if attributes.key?(:'wrapped_array') - if (value = attributes[:'wrapped_array']).is_a?(Array) - self.wrapped_array = value - end - end - - if attributes.key?(:'name_string') - self.name_string = attributes[:'name_string'] - end - - if attributes.key?(:'name_number') - self.name_number = attributes[:'name_number'] - end - - if attributes.key?(:'name_integer') - self.name_integer = attributes[:'name_integer'] - end - - if attributes.key?(:'name_boolean') - self.name_boolean = attributes[:'name_boolean'] - end - - if attributes.key?(:'name_array') - if (value = attributes[:'name_array']).is_a?(Array) - self.name_array = value - end - end - - if attributes.key?(:'name_wrapped_array') - if (value = attributes[:'name_wrapped_array']).is_a?(Array) - self.name_wrapped_array = value - end - end - - if attributes.key?(:'prefix_string') - self.prefix_string = attributes[:'prefix_string'] - end - - if attributes.key?(:'prefix_number') - self.prefix_number = attributes[:'prefix_number'] - end - - if attributes.key?(:'prefix_integer') - self.prefix_integer = attributes[:'prefix_integer'] - end - - if attributes.key?(:'prefix_boolean') - self.prefix_boolean = attributes[:'prefix_boolean'] - end - - if attributes.key?(:'prefix_array') - if (value = attributes[:'prefix_array']).is_a?(Array) - self.prefix_array = value - end - end - - if attributes.key?(:'prefix_wrapped_array') - if (value = attributes[:'prefix_wrapped_array']).is_a?(Array) - self.prefix_wrapped_array = value - end - end - - if attributes.key?(:'namespace_string') - self.namespace_string = attributes[:'namespace_string'] - end - - if attributes.key?(:'namespace_number') - self.namespace_number = attributes[:'namespace_number'] - end - - if attributes.key?(:'namespace_integer') - self.namespace_integer = attributes[:'namespace_integer'] - end - - if attributes.key?(:'namespace_boolean') - self.namespace_boolean = attributes[:'namespace_boolean'] - end - - if attributes.key?(:'namespace_array') - if (value = attributes[:'namespace_array']).is_a?(Array) - self.namespace_array = value - end - end - - if attributes.key?(:'namespace_wrapped_array') - if (value = attributes[:'namespace_wrapped_array']).is_a?(Array) - self.namespace_wrapped_array = value - end - end - - if attributes.key?(:'prefix_ns_string') - self.prefix_ns_string = attributes[:'prefix_ns_string'] - end - - if attributes.key?(:'prefix_ns_number') - self.prefix_ns_number = attributes[:'prefix_ns_number'] - end - - if attributes.key?(:'prefix_ns_integer') - self.prefix_ns_integer = attributes[:'prefix_ns_integer'] - end - - if attributes.key?(:'prefix_ns_boolean') - self.prefix_ns_boolean = attributes[:'prefix_ns_boolean'] - end - - if attributes.key?(:'prefix_ns_array') - if (value = attributes[:'prefix_ns_array']).is_a?(Array) - self.prefix_ns_array = value - end - end - - if attributes.key?(:'prefix_ns_wrapped_array') - if (value = attributes[:'prefix_ns_wrapped_array']).is_a?(Array) - self.prefix_ns_wrapped_array = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attribute_string == o.attribute_string && - attribute_number == o.attribute_number && - attribute_integer == o.attribute_integer && - attribute_boolean == o.attribute_boolean && - wrapped_array == o.wrapped_array && - name_string == o.name_string && - name_number == o.name_number && - name_integer == o.name_integer && - name_boolean == o.name_boolean && - name_array == o.name_array && - name_wrapped_array == o.name_wrapped_array && - prefix_string == o.prefix_string && - prefix_number == o.prefix_number && - prefix_integer == o.prefix_integer && - prefix_boolean == o.prefix_boolean && - prefix_array == o.prefix_array && - prefix_wrapped_array == o.prefix_wrapped_array && - namespace_string == o.namespace_string && - namespace_number == o.namespace_number && - namespace_integer == o.namespace_integer && - namespace_boolean == o.namespace_boolean && - namespace_array == o.namespace_array && - namespace_wrapped_array == o.namespace_wrapped_array && - prefix_ns_string == o.prefix_ns_string && - prefix_ns_number == o.prefix_ns_number && - prefix_ns_integer == o.prefix_ns_integer && - prefix_ns_boolean == o.prefix_ns_boolean && - prefix_ns_array == o.prefix_ns_array && - prefix_ns_wrapped_array == o.prefix_ns_wrapped_array - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attribute_string, attribute_number, attribute_integer, attribute_boolean, wrapped_array, name_string, name_number, name_integer, name_boolean, name_array, name_wrapped_array, prefix_string, prefix_number, prefix_integer, prefix_boolean, prefix_array, prefix_wrapped_array, namespace_string, namespace_number, namespace_integer, namespace_boolean, namespace_array, namespace_wrapped_array, prefix_ns_string, prefix_ns_number, prefix_ns_integer, prefix_ns_boolean, prefix_ns_array, prefix_ns_wrapped_array].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/petstore_profiling.output b/samples/client/petstore/ruby/petstore_profiling.output similarity index 100% rename from samples/openapi3/client/petstore/ruby/petstore_profiling.output rename to samples/client/petstore/ruby/petstore_profiling.output diff --git a/samples/openapi3/client/petstore/ruby/petstore_profiling.rb b/samples/client/petstore/ruby/petstore_profiling.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/petstore_profiling.rb rename to samples/client/petstore/ruby/petstore_profiling.rb diff --git a/samples/openapi3/client/petstore/ruby/pom.xml b/samples/client/petstore/ruby/pom.xml similarity index 100% rename from samples/openapi3/client/petstore/ruby/pom.xml rename to samples/client/petstore/ruby/pom.xml diff --git a/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb b/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb index a83b3e64916d..bf187f0971fe 100644 --- a/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb @@ -35,7 +35,7 @@ # unit tests for call_123_test_special_tags # To test special tags # To test special tags and operation ID starting with number - # @param body client model + # @param client client model # @param [Hash] opts the optional parameters # @return [Client] describe 'call_123_test_special_tags test' do diff --git a/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb b/samples/client/petstore/ruby/spec/api/default_api_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb rename to samples/client/petstore/ruby/spec/api/default_api_spec.rb diff --git a/samples/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/client/petstore/ruby/spec/api/fake_api_spec.rb index 07700af73604..7374568eaf0d 100644 --- a/samples/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -32,13 +32,24 @@ end end - # unit tests for create_xml_item - # creates an XmlItem - # this route creates an XmlItem - # @param xml_item XmlItem Body + # unit tests for fake_health_get + # Health check endpoint # @param [Hash] opts the optional parameters + # @return [HealthCheckResult] + describe 'fake_health_get test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_http_signature_test + # test http signature authentication + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter # @return [nil] - describe 'create_xml_item test' do + describe 'fake_http_signature_test test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end @@ -58,7 +69,7 @@ # unit tests for fake_outer_composite_serialize # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :body Input composite as post body + # @option opts [OuterComposite] :outer_composite Input composite as post body # @return [OuterComposite] describe 'fake_outer_composite_serialize test' do it 'should work' do @@ -90,7 +101,7 @@ # unit tests for test_body_with_file_schema # For this test, the body for this request much reference a schema named `File`. - # @param body + # @param file_schema_test_class # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_file_schema test' do @@ -101,7 +112,7 @@ # unit tests for test_body_with_query_params # @param query - # @param body + # @param user # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_query_params test' do @@ -113,7 +124,7 @@ # unit tests for test_client_model # To test \"client\" model # To test \"client\" model - # @param body client model + # @param client client model # @param [Hash] opts the optional parameters # @return [Client] describe 'test_client_model test' do @@ -123,8 +134,8 @@ end # unit tests for test_endpoint_parameters - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # @param number None # @param double None # @param pattern_without_delimiter None @@ -185,7 +196,7 @@ # unit tests for test_inline_additional_properties # test inline additionalProperties - # @param param request body + # @param request_body request body # @param [Hash] opts the optional parameters # @return [nil] describe 'test_inline_additional_properties test' do diff --git a/samples/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb b/samples/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb index eff08f1c93c1..1db2b3c9ef52 100644 --- a/samples/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb @@ -35,7 +35,7 @@ # unit tests for test_classname # To test class name in snake case # To test class name in snake case - # @param body client model + # @param client client model # @param [Hash] opts the optional parameters # @return [Client] describe 'test_classname test' do diff --git a/samples/client/petstore/ruby/spec/api/pet_api_spec.rb b/samples/client/petstore/ruby/spec/api/pet_api_spec.rb index ca3fcccb2077..26ca32b2f754 100644 --- a/samples/client/petstore/ruby/spec/api/pet_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/pet_api_spec.rb @@ -34,7 +34,7 @@ # unit tests for add_pet # Add a new pet to the store - # @param body Pet object that needs to be added to the store + # @param pet Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] describe 'add_pet test' do @@ -93,7 +93,7 @@ # unit tests for update_pet # Update an existing pet - # @param body Pet object that needs to be added to the store + # @param pet Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] describe 'update_pet test' do diff --git a/samples/client/petstore/ruby/spec/api/store_api_spec.rb b/samples/client/petstore/ruby/spec/api/store_api_spec.rb index 2e82a54da147..1fd9faf40aaf 100644 --- a/samples/client/petstore/ruby/spec/api/store_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/store_api_spec.rb @@ -69,7 +69,7 @@ # unit tests for place_order # Place an order for a pet - # @param body order placed for purchasing the pet + # @param order order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] describe 'place_order test' do diff --git a/samples/client/petstore/ruby/spec/api/user_api_spec.rb b/samples/client/petstore/ruby/spec/api/user_api_spec.rb index 1c0b025a3c30..39178c5a5ac7 100644 --- a/samples/client/petstore/ruby/spec/api/user_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/user_api_spec.rb @@ -35,7 +35,7 @@ # unit tests for create_user # Create user # This can only be done by the logged in user. - # @param body Created user object + # @param user Created user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_user test' do @@ -46,7 +46,7 @@ # unit tests for create_users_with_array_input # Creates list of users with given input array - # @param body List of user object + # @param user List of user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_users_with_array_input test' do @@ -57,7 +57,7 @@ # unit tests for create_users_with_list_input # Creates list of users with given input array - # @param body List of user object + # @param user List of user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_users_with_list_input test' do @@ -115,7 +115,7 @@ # Updated user # This can only be done by the logged in user. # @param username name that need to be deleted - # @param body Updated user object + # @param user Updated user object # @param [Hash] opts the optional parameters # @return [nil] describe 'update_user test' do diff --git a/samples/openapi3/client/petstore/ruby/spec/custom/api_error_spec.rb b/samples/client/petstore/ruby/spec/custom/api_error_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/custom/api_error_spec.rb rename to samples/client/petstore/ruby/spec/custom/api_error_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/custom/base_object_spec.rb b/samples/client/petstore/ruby/spec/custom/base_object_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/custom/base_object_spec.rb rename to samples/client/petstore/ruby/spec/custom/base_object_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb b/samples/client/petstore/ruby/spec/custom/pet_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb rename to samples/client/petstore/ruby/spec/custom/pet_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/custom/store_spec.rb b/samples/client/petstore/ruby/spec/custom/store_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/custom/store_spec.rb rename to samples/client/petstore/ruby/spec/custom/store_spec.rb diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_any_type_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_any_type_spec.rb deleted file mode 100644 index 9fd0455c8d1c..000000000000 --- a/samples/client/petstore/ruby/spec/models/additional_properties_any_type_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesAnyType -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesAnyType' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesAnyType.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesAnyType' do - it 'should create an instance of AdditionalPropertiesAnyType' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesAnyType) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_array_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_array_spec.rb deleted file mode 100644 index 5f3e0b379870..000000000000 --- a/samples/client/petstore/ruby/spec/models/additional_properties_array_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesArray -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesArray' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesArray.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesArray' do - it 'should create an instance of AdditionalPropertiesArray' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesArray) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_boolean_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_boolean_spec.rb deleted file mode 100644 index c586dfe067a6..000000000000 --- a/samples/client/petstore/ruby/spec/models/additional_properties_boolean_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesBoolean -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesBoolean' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesBoolean.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesBoolean' do - it 'should create an instance of AdditionalPropertiesBoolean' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesBoolean) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb index ee65b12fcc11..93a5b0d5fb46 100644 --- a/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb @@ -32,67 +32,13 @@ expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass) end end - describe 'test attribute "map_string"' do + describe 'test attribute "map_property"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "map_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_array_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_array_anytype"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_map_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_map_anytype"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "anytype_1"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "anytype_2"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "anytype_3"' do + describe 'test attribute "map_of_map_property"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_integer_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_integer_spec.rb deleted file mode 100644 index 2bc9d2238a27..000000000000 --- a/samples/client/petstore/ruby/spec/models/additional_properties_integer_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesInteger -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesInteger' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesInteger.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesInteger' do - it 'should create an instance of AdditionalPropertiesInteger' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesInteger) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_number_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_number_spec.rb deleted file mode 100644 index 9cb2c965c962..000000000000 --- a/samples/client/petstore/ruby/spec/models/additional_properties_number_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesNumber -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesNumber' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesNumber.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesNumber' do - it 'should create an instance of AdditionalPropertiesNumber' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesNumber) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_object_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_object_spec.rb deleted file mode 100644 index c8cfee233f0b..000000000000 --- a/samples/client/petstore/ruby/spec/models/additional_properties_object_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesObject -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesObject' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesObject.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesObject' do - it 'should create an instance of AdditionalPropertiesObject' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesObject) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_string_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_string_spec.rb deleted file mode 100644 index d658f5064738..000000000000 --- a/samples/client/petstore/ruby/spec/models/additional_properties_string_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesString -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesString' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesString.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesString' do - it 'should create an instance of AdditionalPropertiesString' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesString) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb deleted file mode 100644 index 0b9749e9cdb9..000000000000 --- a/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::BigCatAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'BigCatAllOf' do - before do - # run before each test - @instance = Petstore::BigCatAllOf.new - end - - after do - # run after each test - end - - describe 'test an instance of BigCatAllOf' do - it 'should create an instance of BigCatAllOf' do - expect(@instance).to be_instance_of(Petstore::BigCatAllOf) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { @instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/big_cat_spec.rb b/samples/client/petstore/ruby/spec/models/big_cat_spec.rb deleted file mode 100644 index 53c783104ca9..000000000000 --- a/samples/client/petstore/ruby/spec/models/big_cat_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::BigCat -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'BigCat' do - before do - # run before each test - @instance = Petstore::BigCat.new - end - - after do - # run after each test - end - - describe 'test an instance of BigCat' do - it 'should create an instance of BigCat' do - expect(@instance).to be_instance_of(Petstore::BigCat) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { @instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/enum_test_spec.rb b/samples/client/petstore/ruby/spec/models/enum_test_spec.rb index acd89c52dfe0..7f4c9c97e871 100644 --- a/samples/client/petstore/ruby/spec/models/enum_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/enum_test_spec.rb @@ -78,4 +78,22 @@ end end + describe 'test attribute "outer_enum_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "outer_enum_default_value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "outer_enum_integer_default_value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb b/samples/client/petstore/ruby/spec/models/foo_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb rename to samples/client/petstore/ruby/spec/models/foo_spec.rb diff --git a/samples/client/petstore/ruby/spec/models/format_test_spec.rb b/samples/client/petstore/ruby/spec/models/format_test_spec.rb index 953fc14a6d1c..72fe239f298e 100644 --- a/samples/client/petstore/ruby/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/format_test_spec.rb @@ -110,7 +110,13 @@ end end - describe 'test attribute "big_decimal"' do + describe 'test attribute "pattern_with_digits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern_with_digits_and_delimiter"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb b/samples/client/petstore/ruby/spec/models/health_check_result_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb rename to samples/client/petstore/ruby/spec/models/health_check_result_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object1_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb rename to samples/client/petstore/ruby/spec/models/inline_object1_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object2_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb rename to samples/client/petstore/ruby/spec/models/inline_object2_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object3_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb rename to samples/client/petstore/ruby/spec/models/inline_object3_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object4_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb rename to samples/client/petstore/ruby/spec/models/inline_object4_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object5_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb rename to samples/client/petstore/ruby/spec/models/inline_object5_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb rename to samples/client/petstore/ruby/spec/models/inline_object_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb b/samples/client/petstore/ruby/spec/models/inline_response_default_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb rename to samples/client/petstore/ruby/spec/models/inline_response_default_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb b/samples/client/petstore/ruby/spec/models/nullable_class_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb rename to samples/client/petstore/ruby/spec/models/nullable_class_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb b/samples/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb rename to samples/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb b/samples/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb rename to samples/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb b/samples/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb rename to samples/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb diff --git a/samples/client/petstore/ruby/spec/models/type_holder_default_spec.rb b/samples/client/petstore/ruby/spec/models/type_holder_default_spec.rb deleted file mode 100644 index b7bf49dbca40..000000000000 --- a/samples/client/petstore/ruby/spec/models/type_holder_default_spec.rb +++ /dev/null @@ -1,65 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::TypeHolderDefault -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'TypeHolderDefault' do - before do - # run before each test - @instance = Petstore::TypeHolderDefault.new - end - - after do - # run after each test - end - - describe 'test an instance of TypeHolderDefault' do - it 'should create an instance of TypeHolderDefault' do - expect(@instance).to be_instance_of(Petstore::TypeHolderDefault) - end - end - describe 'test attribute "string_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "number_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "integer_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "bool_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "array_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/type_holder_example_spec.rb b/samples/client/petstore/ruby/spec/models/type_holder_example_spec.rb deleted file mode 100644 index ba58952fcc33..000000000000 --- a/samples/client/petstore/ruby/spec/models/type_holder_example_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::TypeHolderExample -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'TypeHolderExample' do - before do - # run before each test - @instance = Petstore::TypeHolderExample.new - end - - after do - # run after each test - end - - describe 'test an instance of TypeHolderExample' do - it 'should create an instance of TypeHolderExample' do - expect(@instance).to be_instance_of(Petstore::TypeHolderExample) - end - end - describe 'test attribute "string_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "number_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "float_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "integer_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "bool_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "array_item"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/xml_item_spec.rb b/samples/client/petstore/ruby/spec/models/xml_item_spec.rb deleted file mode 100644 index 8f300f2f8ad3..000000000000 --- a/samples/client/petstore/ruby/spec/models/xml_item_spec.rb +++ /dev/null @@ -1,209 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::XmlItem -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'XmlItem' do - before do - # run before each test - @instance = Petstore::XmlItem.new - end - - after do - # run after each test - end - - describe 'test an instance of XmlItem' do - it 'should create an instance of XmlItem' do - expect(@instance).to be_instance_of(Petstore::XmlItem) - end - end - describe 'test attribute "attribute_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "attribute_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "attribute_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "attribute_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name_wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "namespace_wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "prefix_ns_wrapped_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb b/samples/client/petstore/ruby/spec/petstore_helper.rb similarity index 100% rename from samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb rename to samples/client/petstore/ruby/spec/petstore_helper.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/.gitignore b/samples/openapi3/client/petstore/ruby-faraday/.gitignore deleted file mode 100644 index 05a17cb8f0a0..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://openapi-generator.tech -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator-ignore b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/FILES deleted file mode 100644 index 61a40c4b9a02..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/FILES +++ /dev/null @@ -1,186 +0,0 @@ -.gitignore -.rspec -.rubocop.yml -.travis.yml -Gemfile -README.md -Rakefile -docs/AdditionalPropertiesClass.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/DefaultApi.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/Foo.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md -docs/InlineResponseDefault.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Name.md -docs/NullableClass.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterEnumDefaultValue.md -docs/OuterEnumInteger.md -docs/OuterEnumIntegerDefaultValue.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/User.md -docs/UserApi.md -git_push.sh -lib/petstore.rb -lib/petstore/api/another_fake_api.rb -lib/petstore/api/default_api.rb -lib/petstore/api/fake_api.rb -lib/petstore/api/fake_classname_tags123_api.rb -lib/petstore/api/pet_api.rb -lib/petstore/api/store_api.rb -lib/petstore/api/user_api.rb -lib/petstore/api_client.rb -lib/petstore/api_error.rb -lib/petstore/configuration.rb -lib/petstore/configuration.rb -lib/petstore/models/additional_properties_class.rb -lib/petstore/models/animal.rb -lib/petstore/models/api_response.rb -lib/petstore/models/array_of_array_of_number_only.rb -lib/petstore/models/array_of_number_only.rb -lib/petstore/models/array_test.rb -lib/petstore/models/capitalization.rb -lib/petstore/models/cat.rb -lib/petstore/models/cat_all_of.rb -lib/petstore/models/category.rb -lib/petstore/models/class_model.rb -lib/petstore/models/client.rb -lib/petstore/models/dog.rb -lib/petstore/models/dog_all_of.rb -lib/petstore/models/enum_arrays.rb -lib/petstore/models/enum_class.rb -lib/petstore/models/enum_test.rb -lib/petstore/models/file.rb -lib/petstore/models/file_schema_test_class.rb -lib/petstore/models/foo.rb -lib/petstore/models/format_test.rb -lib/petstore/models/has_only_read_only.rb -lib/petstore/models/health_check_result.rb -lib/petstore/models/inline_object.rb -lib/petstore/models/inline_object1.rb -lib/petstore/models/inline_object2.rb -lib/petstore/models/inline_object3.rb -lib/petstore/models/inline_object4.rb -lib/petstore/models/inline_object5.rb -lib/petstore/models/inline_response_default.rb -lib/petstore/models/list.rb -lib/petstore/models/map_test.rb -lib/petstore/models/mixed_properties_and_additional_properties_class.rb -lib/petstore/models/model200_response.rb -lib/petstore/models/model_return.rb -lib/petstore/models/name.rb -lib/petstore/models/nullable_class.rb -lib/petstore/models/number_only.rb -lib/petstore/models/order.rb -lib/petstore/models/outer_composite.rb -lib/petstore/models/outer_enum.rb -lib/petstore/models/outer_enum_default_value.rb -lib/petstore/models/outer_enum_integer.rb -lib/petstore/models/outer_enum_integer_default_value.rb -lib/petstore/models/pet.rb -lib/petstore/models/read_only_first.rb -lib/petstore/models/special_model_name.rb -lib/petstore/models/tag.rb -lib/petstore/models/user.rb -lib/petstore/version.rb -petstore.gemspec -spec/api/another_fake_api_spec.rb -spec/api/default_api_spec.rb -spec/api/fake_api_spec.rb -spec/api/fake_classname_tags123_api_spec.rb -spec/api/pet_api_spec.rb -spec/api/store_api_spec.rb -spec/api/user_api_spec.rb -spec/api_client_spec.rb -spec/configuration_spec.rb -spec/models/additional_properties_class_spec.rb -spec/models/animal_spec.rb -spec/models/api_response_spec.rb -spec/models/array_of_array_of_number_only_spec.rb -spec/models/array_of_number_only_spec.rb -spec/models/array_test_spec.rb -spec/models/capitalization_spec.rb -spec/models/cat_all_of_spec.rb -spec/models/cat_spec.rb -spec/models/category_spec.rb -spec/models/class_model_spec.rb -spec/models/client_spec.rb -spec/models/dog_all_of_spec.rb -spec/models/dog_spec.rb -spec/models/enum_arrays_spec.rb -spec/models/enum_class_spec.rb -spec/models/enum_test_spec.rb -spec/models/file_schema_test_class_spec.rb -spec/models/file_spec.rb -spec/models/foo_spec.rb -spec/models/format_test_spec.rb -spec/models/has_only_read_only_spec.rb -spec/models/health_check_result_spec.rb -spec/models/inline_object1_spec.rb -spec/models/inline_object2_spec.rb -spec/models/inline_object3_spec.rb -spec/models/inline_object4_spec.rb -spec/models/inline_object5_spec.rb -spec/models/inline_object_spec.rb -spec/models/inline_response_default_spec.rb -spec/models/list_spec.rb -spec/models/map_test_spec.rb -spec/models/mixed_properties_and_additional_properties_class_spec.rb -spec/models/model200_response_spec.rb -spec/models/model_return_spec.rb -spec/models/name_spec.rb -spec/models/nullable_class_spec.rb -spec/models/number_only_spec.rb -spec/models/order_spec.rb -spec/models/outer_composite_spec.rb -spec/models/outer_enum_default_value_spec.rb -spec/models/outer_enum_integer_default_value_spec.rb -spec/models/outer_enum_integer_spec.rb -spec/models/outer_enum_spec.rb -spec/models/pet_spec.rb -spec/models/read_only_first_spec.rb -spec/models/special_model_name_spec.rb -spec/models/tag_spec.rb -spec/models/user_spec.rb -spec/spec_helper.rb diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01f..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby-faraday/.rspec b/samples/openapi3/client/petstore/ruby-faraday/.rspec deleted file mode 100644 index 83e16f804474..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/samples/openapi3/client/petstore/ruby-faraday/.rubocop.yml b/samples/openapi3/client/petstore/ruby-faraday/.rubocop.yml deleted file mode 100644 index df46058490d0..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/.rubocop.yml +++ /dev/null @@ -1,148 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) -AllCops: - TargetRubyVersion: 2.4 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstArgumentIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: indented_internal_methods - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingEmptyLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/RedundantPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Layout/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/samples/openapi3/client/petstore/ruby-faraday/.travis.yml b/samples/openapi3/client/petstore/ruby-faraday/.travis.yml deleted file mode 100644 index d2d526df5942..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: ruby -cache: bundler -rvm: - - 2.3 - - 2.4 - - 2.5 -script: - - bundle install --path vendor/bundle - - bundle exec rspec - - gem build petstore.gemspec - - gem install ./petstore-1.0.0.gem diff --git a/samples/openapi3/client/petstore/ruby-faraday/Gemfile b/samples/openapi3/client/petstore/ruby-faraday/Gemfile deleted file mode 100644 index c2e3127cdcfe..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/README.md b/samples/openapi3/client/petstore/ruby-faraday/README.md deleted file mode 100644 index 719039e53116..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/README.md +++ /dev/null @@ -1,209 +0,0 @@ -# petstore - -Petstore - the Ruby gem for the OpenAPI 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 [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.RubyClientCodegen - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build petstore.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./petstore-1.0.0.gem -``` - -(for development, run `gem install --dev ./petstore-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'petstore', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: - -```ruby -# Load the gem -require 'petstore' - -api_instance = Petstore::AnotherFakeApi.new -client = Petstore::Client.new # Client | client model - -begin - #To test special tags - result = api_instance.call_123_test_special_tags(client) - p result -rescue Petstore::ApiError => e - puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" -end - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | -*Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication -*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*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_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | -*Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*Petstore::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*Petstore::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*Petstore::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*Petstore::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*Petstore::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*Petstore::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*Petstore::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*Petstore::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*Petstore::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation for Models - - - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Petstore::Animal](docs/Animal.md) - - [Petstore::ApiResponse](docs/ApiResponse.md) - - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [Petstore::ArrayTest](docs/ArrayTest.md) - - [Petstore::Capitalization](docs/Capitalization.md) - - [Petstore::Cat](docs/Cat.md) - - [Petstore::CatAllOf](docs/CatAllOf.md) - - [Petstore::Category](docs/Category.md) - - [Petstore::ClassModel](docs/ClassModel.md) - - [Petstore::Client](docs/Client.md) - - [Petstore::Dog](docs/Dog.md) - - [Petstore::DogAllOf](docs/DogAllOf.md) - - [Petstore::EnumArrays](docs/EnumArrays.md) - - [Petstore::EnumClass](docs/EnumClass.md) - - [Petstore::EnumTest](docs/EnumTest.md) - - [Petstore::File](docs/File.md) - - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Petstore::Foo](docs/Foo.md) - - [Petstore::FormatTest](docs/FormatTest.md) - - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) - - [Petstore::InlineObject](docs/InlineObject.md) - - [Petstore::InlineObject1](docs/InlineObject1.md) - - [Petstore::InlineObject2](docs/InlineObject2.md) - - [Petstore::InlineObject3](docs/InlineObject3.md) - - [Petstore::InlineObject4](docs/InlineObject4.md) - - [Petstore::InlineObject5](docs/InlineObject5.md) - - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) - - [Petstore::List](docs/List.md) - - [Petstore::MapTest](docs/MapTest.md) - - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Petstore::Model200Response](docs/Model200Response.md) - - [Petstore::ModelReturn](docs/ModelReturn.md) - - [Petstore::Name](docs/Name.md) - - [Petstore::NullableClass](docs/NullableClass.md) - - [Petstore::NumberOnly](docs/NumberOnly.md) - - [Petstore::Order](docs/Order.md) - - [Petstore::OuterComposite](docs/OuterComposite.md) - - [Petstore::OuterEnum](docs/OuterEnum.md) - - [Petstore::OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [Petstore::OuterEnumInteger](docs/OuterEnumInteger.md) - - [Petstore::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [Petstore::Pet](docs/Pet.md) - - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Petstore::SpecialModelName](docs/SpecialModelName.md) - - [Petstore::Tag](docs/Tag.md) - - [Petstore::User](docs/User.md) - - -## Documentation for Authorization - - -### api_key - - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -### api_key_query - - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -### bearer_test - -- **Type**: Bearer authentication (JWT) - -### http_basic_test - -- **Type**: HTTP basic authentication - -### http_signature_test - - -### petstore_auth - - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - write:pets: modify pets in your account - - read:pets: read your pets - diff --git a/samples/openapi3/client/petstore/ruby-faraday/Rakefile b/samples/openapi3/client/petstore/ruby-faraday/Rakefile deleted file mode 100644 index c72ca30d454e..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require "bundler/gem_tasks" - -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e0d6811081cd..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::AdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_property** | **Hash<String, String>** | | [optional] -**map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesClass.new(map_property: null, - map_of_map_property: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Animal.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Animal.md deleted file mode 100644 index 80e132d13e45..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Animal.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::Animal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **String** | | -**color** | **String** | | [optional] [default to 'red'] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Animal.new(class_name: null, - color: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/AnotherFakeApi.md deleted file mode 100644 index d7b52283ea50..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/AnotherFakeApi.md +++ /dev/null @@ -1,56 +0,0 @@ -# Petstore::AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - - -## call_123_test_special_tags - -> Client call_123_test_special_tags(client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::AnotherFakeApi.new -client = Petstore::Client.new # Client | client model - -begin - #To test special tags - result = api_instance.call_123_test_special_tags(client) - p result -rescue Petstore::ApiError => e - puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ApiResponse.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ApiResponse.md deleted file mode 100644 index c0ac7c4b4c17..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/ApiResponse.md +++ /dev/null @@ -1,21 +0,0 @@ -# Petstore::ApiResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ApiResponse.new(code: null, - type: null, - message: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 5bb9ff33be21..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::ArrayOfArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **Array<Array<Float>>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ArrayOfArrayOfNumberOnly.new(array_array_number: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 8adb00978acc..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::ArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **Array<Float>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ArrayOfNumberOnly.new(array_number: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayTest.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayTest.md deleted file mode 100644 index 76e3866ba9c2..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayTest.md +++ /dev/null @@ -1,21 +0,0 @@ -# Petstore::ArrayTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **Array<String>** | | [optional] -**array_array_of_integer** | **Array<Array<Integer>>** | | [optional] -**array_array_of_model** | **Array<Array<ReadOnlyFirst>>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ArrayTest.new(array_of_string: null, - array_array_of_integer: null, - array_array_of_model: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Capitalization.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Capitalization.md deleted file mode 100644 index d1ac69ceb185..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Capitalization.md +++ /dev/null @@ -1,27 +0,0 @@ -# Petstore::Capitalization - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **String** | | [optional] -**capital_camel** | **String** | | [optional] -**small_snake** | **String** | | [optional] -**capital_snake** | **String** | | [optional] -**sca_eth_flow_points** | **String** | | [optional] -**att_name** | **String** | Name of the pet | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Capitalization.new(small_camel: null, - capital_camel: null, - small_snake: null, - capital_snake: null, - sca_eth_flow_points: null, - att_name: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Cat.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Cat.md deleted file mode 100644 index 054fbfadafd3..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Cat.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::Cat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Boolean** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Cat.new(declawed: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/CatAllOf.md b/samples/openapi3/client/petstore/ruby-faraday/docs/CatAllOf.md deleted file mode 100644 index a83a6f756620..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/CatAllOf.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::CatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Boolean** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::CatAllOf.new(declawed: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Category.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Category.md deleted file mode 100644 index 942f88759ea6..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Category.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::Category - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**name** | **String** | | [default to 'default-name'] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Category.new(id: null, - name: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ClassModel.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ClassModel.md deleted file mode 100644 index faf38fde16d9..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/ClassModel.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::ClassModel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ClassModel.new(_class: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Client.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Client.md deleted file mode 100644 index da87ce113cb3..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Client.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::Client - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Client.new(client: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Dog.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Dog.md deleted file mode 100644 index 68c2e5d7e0e5..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Dog.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::Dog - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Dog.new(breed: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/DogAllOf.md b/samples/openapi3/client/petstore/ruby-faraday/docs/DogAllOf.md deleted file mode 100644 index 6107fd0c10f5..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/DogAllOf.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::DogAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::DogAllOf.new(breed: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumArrays.md b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumArrays.md deleted file mode 100644 index 18efa20299d0..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumArrays.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::EnumArrays - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **String** | | [optional] -**array_enum** | **Array<String>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::EnumArrays.new(just_symbol: null, - array_enum: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumClass.md deleted file mode 100644 index 0fca9b27f5ce..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# Petstore::EnumClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::EnumClass.new() -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumTest.md b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumTest.md deleted file mode 100644 index e43f07205363..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumTest.md +++ /dev/null @@ -1,31 +0,0 @@ -# Petstore::EnumTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string** | **String** | | [optional] -**enum_string_required** | **String** | | -**enum_integer** | **Integer** | | [optional] -**enum_number** | **Float** | | [optional] -**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::EnumTest.new(enum_string: null, - enum_string_required: null, - enum_integer: null, - enum_number: null, - outer_enum: null, - outer_enum_integer: null, - outer_enum_default_value: null, - outer_enum_integer_default_value: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md deleted file mode 100644 index 4552514bc792..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md +++ /dev/null @@ -1,794 +0,0 @@ -# Petstore::FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**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_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | - - - -## fake_health_get - -> HealthCheckResult fake_health_get - -Health check endpoint - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new - -begin - #Health check endpoint - result = api_instance.fake_health_get - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_health_get: #{e}" -end -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## fake_http_signature_test - -> fake_http_signature_test(pet, opts) - -test http signature authentication - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| -end - -api_instance = Petstore::FakeApi.new -pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store -opts = { - query_1: 'query_1_example', # String | query parameter - header_1: 'header_1_example' # String | header parameter -} - -begin - #test http signature authentication - api_instance.fake_http_signature_test(pet, opts) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_http_signature_test: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query_1** | **String**| query parameter | [optional] - **header_1** | **String**| header parameter | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## fake_outer_boolean_serialize - -> Boolean fake_outer_boolean_serialize(opts) - - - -Test serialization of outer boolean types - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - body: true # Boolean | Input boolean as post body -} - -begin - result = api_instance.fake_outer_boolean_serialize(opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_boolean_serialize: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Boolean**| Input boolean as post body | [optional] - -### Return type - -**Boolean** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - - -## fake_outer_composite_serialize - -> OuterComposite fake_outer_composite_serialize(opts) - - - -Test serialization of object with outer number type - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body -} - -begin - result = api_instance.fake_outer_composite_serialize(opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_composite_serialize: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - - -## fake_outer_number_serialize - -> Float fake_outer_number_serialize(opts) - - - -Test serialization of outer number types - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - body: 3.4 # Float | Input number as post body -} - -begin - result = api_instance.fake_outer_number_serialize(opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_number_serialize: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Float**| Input number as post body | [optional] - -### Return type - -**Float** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - - -## fake_outer_string_serialize - -> String fake_outer_string_serialize(opts) - - - -Test serialization of outer string types - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - body: 'body_example' # String | Input string as post body -} - -begin - result = api_instance.fake_outer_string_serialize(opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_string_serialize: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String**| Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - - -## test_body_with_file_schema - -> test_body_with_file_schema(file_schema_test_class) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | - -begin - api_instance.test_body_with_file_schema(file_schema_test_class) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## test_body_with_query_params - -> test_body_with_query_params(query, user) - - - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -query = 'query_example' # String | -user = Petstore::User.new # User | - -begin - api_instance.test_body_with_query_params(query, user) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_body_with_query_params: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String**| | - **user** | [**User**](User.md)| | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## test_client_model - -> Client test_client_model(client) - -To test \"client\" model - -To test \"client\" model - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -client = Petstore::Client.new # Client | client model - -begin - #To test \"client\" model - result = api_instance.test_client_model(client) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_client_model: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## test_endpoint_parameters - -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure HTTP basic authorization: http_basic_test - config.username = 'YOUR USERNAME' - config.password = 'YOUR PASSWORD' -end - -api_instance = Petstore::FakeApi.new -number = 3.4 # Float | None -double = 3.4 # Float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # String | None -byte = 'byte_example' # String | None -opts = { - integer: 56, # Integer | None - int32: 56, # Integer | None - int64: 56, # Integer | None - float: 3.4, # Float | None - string: 'string_example', # String | None - binary: File.new('/path/to/file'), # File | None - date: Date.parse('2013-10-20'), # Date | None - date_time: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | None - password: 'password_example', # String | None - callback: 'callback_example' # String | None -} - -begin - #Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_endpoint_parameters: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **Float**| None | - **double** | **Float**| None | - **pattern_without_delimiter** | **String**| None | - **byte** | **String**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Integer**| None | [optional] - **float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **File**| None | [optional] - **date** | **Date**| None | [optional] - **date_time** | **DateTime**| None | [optional] - **password** | **String**| None | [optional] - **callback** | **String**| None | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## test_enum_parameters - -> test_enum_parameters(opts) - -To test enum parameters - -To test enum parameters - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - enum_header_string_array: ['enum_header_string_array_example'], # Array | Header parameter enum test (string array) - enum_header_string: '-efg', # String | Header parameter enum test (string) - enum_query_string_array: ['enum_query_string_array_example'], # Array | Query parameter enum test (string array) - enum_query_string: '-efg', # String | Query parameter enum test (string) - 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: '$', # Array | Form parameter enum test (string array) - enum_form_string: '-efg' # String | Form parameter enum test (string) -} - -begin - #To test enum parameters - api_instance.test_enum_parameters(opts) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_enum_parameters: #{e}" -end -``` - -### Parameters - - -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_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_integer** | **Integer**| Query parameter enum test (double) | [optional] - **enum_query_double** | **Float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**Array<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## test_group_parameters - -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure Bearer authorization (JWT): bearer_test - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = Petstore::FakeApi.new -required_string_group = 56 # Integer | Required String in group parameters -required_boolean_group = true # Boolean | Required Boolean in group parameters -required_int64_group = 56 # Integer | Required Integer in group parameters -opts = { - string_group: 56, # Integer | String in group parameters - boolean_group: true, # Boolean | Boolean in group parameters - int64_group: 56 # Integer | Integer in group parameters -} - -begin - #Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_group_parameters: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **Integer**| Required String in group parameters | - **required_boolean_group** | **Boolean**| Required Boolean in group parameters | - **required_int64_group** | **Integer**| Required Integer in group parameters | - **string_group** | **Integer**| String in group parameters | [optional] - **boolean_group** | **Boolean**| Boolean in group parameters | [optional] - **int64_group** | **Integer**| Integer in group parameters | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## test_inline_additional_properties - -> test_inline_additional_properties(request_body) - -test inline additionalProperties - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -request_body = {'key' => 'request_body_example'} # Hash | request body - -begin - #test inline additionalProperties - api_instance.test_inline_additional_properties(request_body) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_body** | [**Hash<String, String>**](String.md)| request body | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## 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/x-www-form-urlencoded -- **Accept**: Not defined - - -## test_query_parameter_collection_format - -> test_query_parameter_collection_format(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -pipe = ['pipe_example'] # Array | -ioutil = ['ioutil_example'] # Array | -http = ['http_example'] # Array | -url = ['url_example'] # Array | -context = ['context_example'] # Array | - -begin - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**Array<String>**](String.md)| | - **ioutil** | [**Array<String>**](String.md)| | - **http** | [**Array<String>**](String.md)| | - **url** | [**Array<String>**](String.md)| | - **context** | [**Array<String>**](String.md)| | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 4ccb9083cbae..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,63 +0,0 @@ -# Petstore::FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -## test_classname - -> Client test_classname(client) - -To test class name in snake case - -To test class name in snake case - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure API key authorization: api_key_query - config.api_key['api_key_query'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api_key_query'] = 'Bearer' -end - -api_instance = Petstore::FakeClassnameTags123Api.new -client = Petstore::Client.new # Client | client model - -begin - #To test class name in snake case - result = api_instance.test_classname(client) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/File.md b/samples/openapi3/client/petstore/ruby-faraday/docs/File.md deleted file mode 100644 index ca8a6e9c3136..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/File.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::File - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **String** | Test capitalization | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::File.new(source_uri: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md deleted file mode 100644 index 03ee5f7e803b..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::FileSchemaTestClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | **File** | | [optional] -**files** | **Array<File>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::FileSchemaTestClass.new(file: null, - files: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FormatTest.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FormatTest.md deleted file mode 100644 index ca468a3d6506..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/FormatTest.md +++ /dev/null @@ -1,45 +0,0 @@ -# Petstore::FormatTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | | [optional] -**int32** | **Integer** | | [optional] -**int64** | **Integer** | | [optional] -**number** | **Float** | | -**float** | **Float** | | [optional] -**double** | **Float** | | [optional] -**string** | **String** | | [optional] -**byte** | **String** | | -**binary** | **File** | | [optional] -**date** | **Date** | | -**date_time** | **DateTime** | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | -**pattern_with_digits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**pattern_with_digits_and_delimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::FormatTest.new(integer: null, - int32: null, - int64: null, - number: null, - float: null, - double: null, - string: null, - byte: null, - binary: null, - date: null, - date_time: null, - uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84, - password: null, - pattern_with_digits: null, - pattern_with_digits_and_delimiter: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md deleted file mode 100644 index a15219a9c7b1..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::HasOnlyReadOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::HasOnlyReadOnly.new(bar: null, - foo: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/List.md b/samples/openapi3/client/petstore/ruby-faraday/docs/List.md deleted file mode 100644 index 4add9c3fd230..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/List.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::List - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::List.new(_123_list: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/MapTest.md b/samples/openapi3/client/petstore/ruby-faraday/docs/MapTest.md deleted file mode 100644 index 9bf1793ec082..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/MapTest.md +++ /dev/null @@ -1,23 +0,0 @@ -# Petstore::MapTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **Hash<String, Hash<String, String>>** | | [optional] -**map_of_enum_string** | **Hash<String, String>** | | [optional] -**direct_map** | **Hash<String, Boolean>** | | [optional] -**indirect_map** | **Hash<String, Boolean>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::MapTest.new(map_map_of_string: null, - map_of_enum_string: null, - direct_map: null, - indirect_map: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index a0d78f1d0b82..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,21 +0,0 @@ -# Petstore::MixedPropertiesAndAdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**date_time** | **DateTime** | | [optional] -**map** | [**Hash<String, Animal>**](Animal.md) | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new(uuid: null, - date_time: null, - map: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Model200Response.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Model200Response.md deleted file mode 100644 index 07a53b603347..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Model200Response.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::Model200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | [optional] -**_class** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Model200Response.new(name: null, - _class: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ModelReturn.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ModelReturn.md deleted file mode 100644 index 2e155936c898..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/ModelReturn.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::ModelReturn - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Integer** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ModelReturn.new(_return: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Name.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Name.md deleted file mode 100644 index 17cdbbd35612..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Name.md +++ /dev/null @@ -1,23 +0,0 @@ -# Petstore::Name - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | -**snake_case** | **Integer** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123_number** | **Integer** | | [optional] [readonly] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Name.new(name: null, - snake_case: null, - property: null, - _123_number: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/NumberOnly.md b/samples/openapi3/client/petstore/ruby-faraday/docs/NumberOnly.md deleted file mode 100644 index 73c5d0a3ab28..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/NumberOnly.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::NumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **Float** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::NumberOnly.new(just_number: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Order.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Order.md deleted file mode 100644 index e8f38005ae17..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Order.md +++ /dev/null @@ -1,27 +0,0 @@ -# Petstore::Order - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**pet_id** | **Integer** | | [optional] -**quantity** | **Integer** | | [optional] -**ship_date** | **DateTime** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Boolean** | | [optional] [default to false] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Order.new(id: null, - pet_id: null, - quantity: null, - ship_date: null, - status: null, - complete: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterComposite.md b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterComposite.md deleted file mode 100644 index 2716cd298087..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterComposite.md +++ /dev/null @@ -1,21 +0,0 @@ -# Petstore::OuterComposite - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | **Float** | | [optional] -**my_string** | **String** | | [optional] -**my_boolean** | **Boolean** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::OuterComposite.new(my_number: null, - my_string: null, - my_boolean: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnum.md b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnum.md deleted file mode 100644 index e919b6bc78ba..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnum.md +++ /dev/null @@ -1,16 +0,0 @@ -# Petstore::OuterEnum - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::OuterEnum.new() -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Pet.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Pet.md deleted file mode 100644 index efee63091e47..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Pet.md +++ /dev/null @@ -1,27 +0,0 @@ -# Petstore::Pet - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photo_urls** | **Array<String>** | | -**tags** | [**Array<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Pet.new(id: null, - category: null, - name: doggie, - photo_urls: null, - tags: null, - status: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/PetApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/PetApi.md deleted file mode 100644 index 6e650f534b1b..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/PetApi.md +++ /dev/null @@ -1,493 +0,0 @@ -# Petstore::PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - - -## add_pet - -> add_pet(pet) - -Add a new pet to the store - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store - -begin - #Add a new pet to the store - api_instance.add_pet(pet) -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->add_pet: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -nil (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## delete_pet - -> delete_pet(pet_id, opts) - -Deletes a pet - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | Pet id to delete -opts = { - api_key: 'api_key_example' # String | -} - -begin - #Deletes a pet - api_instance.delete_pet(pet_id, opts) -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->delete_pet: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| Pet id to delete | - **api_key** | **String**| | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## find_pets_by_status - -> Array<Pet> find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -status = ['status_example'] # Array | Status values that need to be considered for filter - -begin - #Finds Pets by status - result = api_instance.find_pets_by_status(status) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->find_pets_by_status: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**Array<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**Array<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## find_pets_by_tags - -> Array<Pet> find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -tags = ['tags_example'] # Array | Tags to filter by - -begin - #Finds Pets by tags - result = api_instance.find_pets_by_tags(tags) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->find_pets_by_tags: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**Array<String>**](String.md)| Tags to filter by | - -### Return type - -[**Array<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## get_pet_by_id - -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure API key authorization: api_key - config.api_key['api_key'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api_key'] = 'Bearer' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet to return - -begin - #Find pet by ID - result = api_instance.get_pet_by_id(pet_id) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->get_pet_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## update_pet - -> update_pet(pet) - -Update an existing pet - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store - -begin - #Update an existing pet - api_instance.update_pet(pet) -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->update_pet: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -nil (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## update_pet_with_form - -> update_pet_with_form(pet_id, opts) - -Updates a pet in the store with form data - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet that needs to be updated -opts = { - name: 'name_example', # String | Updated name of the pet - status: 'status_example' # String | Updated status of the pet -} - -begin - #Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, opts) -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->update_pet_with_form: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## upload_file - -> ApiResponse upload_file(pet_id, opts) - -uploads an image - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet to update -opts = { - additional_metadata: 'additional_metadata_example', # String | Additional data to pass to server - file: File.new('/path/to/file') # File | file to upload -} - -begin - #uploads an image - result = api_instance.upload_file(pet_id, opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->upload_file: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet to update | - **additional_metadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - - -## upload_file_with_required_file - -> ApiResponse upload_file_with_required_file(pet_id, required_file, opts) - -uploads an image (required) - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet to update -required_file = File.new('/path/to/file') # File | file to upload -opts = { - additional_metadata: 'additional_metadata_example' # String | Additional data to pass to server -} - -begin - #uploads an image (required) - result = api_instance.upload_file_with_required_file(pet_id, required_file, opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->upload_file_with_required_file: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet to update | - **required_file** | **File**| file to upload | - **additional_metadata** | **String**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md deleted file mode 100644 index f8f76a463a14..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::ReadOnlyFirst - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ReadOnlyFirst.new(bar: null, - baz: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/SpecialModelName.md b/samples/openapi3/client/petstore/ruby-faraday/docs/SpecialModelName.md deleted file mode 100644 index 498ab811683a..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/SpecialModelName.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::SpecialModelName - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **Integer** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::SpecialModelName.new(special_property_name: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/StoreApi.md deleted file mode 100644 index ffbc1d04b1ef..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/StoreApi.md +++ /dev/null @@ -1,200 +0,0 @@ -# Petstore::StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - - -## delete_order - -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::StoreApi.new -order_id = 'order_id_example' # String | ID of the order that needs to be deleted - -begin - #Delete purchase order by ID - api_instance.delete_order(order_id) -rescue Petstore::ApiError => e - puts "Exception when calling StoreApi->delete_order: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **String**| ID of the order that needs to be deleted | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## get_inventory - -> Hash<String, Integer> get_inventory - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure API key authorization: api_key - config.api_key['api_key'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api_key'] = 'Bearer' -end - -api_instance = Petstore::StoreApi.new - -begin - #Returns pet inventories by status - result = api_instance.get_inventory - p result -rescue Petstore::ApiError => e - puts "Exception when calling StoreApi->get_inventory: #{e}" -end -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -**Hash<String, Integer>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_order_by_id - -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::StoreApi.new -order_id = 56 # Integer | ID of pet that needs to be fetched - -begin - #Find purchase order by ID - result = api_instance.get_order_by_id(order_id) - p result -rescue Petstore::ApiError => e - puts "Exception when calling StoreApi->get_order_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **Integer**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## place_order - -> Order place_order(order) - -Place an order for a pet - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::StoreApi.new -order = Petstore::Order.new # Order | order placed for purchasing the pet - -begin - #Place an order for a pet - result = api_instance.place_order(order) - p result -rescue Petstore::ApiError => e - puts "Exception when calling StoreApi->place_order: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/xml, application/json - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Tag.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Tag.md deleted file mode 100644 index 54a66a3f294b..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/Tag.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::Tag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Tag.new(id: null, - name: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/User.md b/samples/openapi3/client/petstore/ruby-faraday/docs/User.md deleted file mode 100644 index 263e96046620..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/User.md +++ /dev/null @@ -1,31 +0,0 @@ -# Petstore::User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**username** | **String** | | [optional] -**first_name** | **String** | | [optional] -**last_name** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**user_status** | **Integer** | User Status | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::User.new(id: null, - username: null, - first_name: null, - last_name: null, - email: null, - password: null, - phone: null, - user_status: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/UserApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/UserApi.md deleted file mode 100644 index 631a65ef1f19..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/UserApi.md +++ /dev/null @@ -1,376 +0,0 @@ -# Petstore::UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - - -## create_user - -> create_user(user) - -Create user - -This can only be done by the logged in user. - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -user = Petstore::User.new # User | Created user object - -begin - #Create user - api_instance.create_user(user) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->create_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## create_users_with_array_input - -> create_users_with_array_input(user) - -Creates list of users with given input array - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -user = [Petstore::User.new] # Array | List of user object - -begin - #Creates list of users with given input array - api_instance.create_users_with_array_input(user) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->create_users_with_array_input: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**Array<User>**](User.md)| List of user object | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## create_users_with_list_input - -> create_users_with_list_input(user) - -Creates list of users with given input array - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -user = [Petstore::User.new] # Array | List of user object - -begin - #Creates list of users with given input array - api_instance.create_users_with_list_input(user) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->create_users_with_list_input: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**Array<User>**](User.md)| List of user object | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## delete_user - -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -username = 'username_example' # String | The name that needs to be deleted - -begin - #Delete user - api_instance.delete_user(username) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->delete_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## get_user_by_name - -> User get_user_by_name(username) - -Get user by user name - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -username = 'username_example' # String | The name that needs to be fetched. Use user1 for testing. - -begin - #Get user by user name - result = api_instance.get_user_by_name(username) - p result -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->get_user_by_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## login_user - -> String login_user(username, password) - -Logs user into the system - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -username = 'username_example' # String | The user name for login -password = 'password_example' # String | The password for login in clear text - -begin - #Logs user into the system - result = api_instance.login_user(username, password) - p result -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->login_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## logout_user - -> logout_user - -Logs out current logged in user session - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new - -begin - #Logs out current logged in user session - api_instance.logout_user -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->logout_user: #{e}" -end -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## update_user - -> update_user(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -username = 'username_example' # String | name that need to be deleted -user = Petstore::User.new # User | Updated user object - -begin - #Updated user - api_instance.update_user(username, user) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->update_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - diff --git a/samples/openapi3/client/petstore/ruby-faraday/git_push.sh b/samples/openapi3/client/petstore/ruby-faraday/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb deleted file mode 100644 index 7f8ae56e123b..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb +++ /dev/null @@ -1,95 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -# Common files -require 'petstore/api_client' -require 'petstore/api_error' -require 'petstore/version' -require 'petstore/configuration' - -# Models -require 'petstore/models/additional_properties_class' -require 'petstore/models/animal' -require 'petstore/models/api_response' -require 'petstore/models/array_of_array_of_number_only' -require 'petstore/models/array_of_number_only' -require 'petstore/models/array_test' -require 'petstore/models/capitalization' -require 'petstore/models/cat' -require 'petstore/models/cat_all_of' -require 'petstore/models/category' -require 'petstore/models/class_model' -require 'petstore/models/client' -require 'petstore/models/dog' -require 'petstore/models/dog_all_of' -require 'petstore/models/enum_arrays' -require 'petstore/models/enum_class' -require 'petstore/models/enum_test' -require 'petstore/models/file' -require 'petstore/models/file_schema_test_class' -require 'petstore/models/foo' -require 'petstore/models/format_test' -require 'petstore/models/has_only_read_only' -require 'petstore/models/health_check_result' -require 'petstore/models/inline_object' -require 'petstore/models/inline_object1' -require 'petstore/models/inline_object2' -require 'petstore/models/inline_object3' -require 'petstore/models/inline_object4' -require 'petstore/models/inline_object5' -require 'petstore/models/inline_response_default' -require 'petstore/models/list' -require 'petstore/models/map_test' -require 'petstore/models/mixed_properties_and_additional_properties_class' -require 'petstore/models/model200_response' -require 'petstore/models/model_return' -require 'petstore/models/name' -require 'petstore/models/nullable_class' -require 'petstore/models/number_only' -require 'petstore/models/order' -require 'petstore/models/outer_composite' -require 'petstore/models/outer_enum' -require 'petstore/models/outer_enum_default_value' -require 'petstore/models/outer_enum_integer' -require 'petstore/models/outer_enum_integer_default_value' -require 'petstore/models/pet' -require 'petstore/models/read_only_first' -require 'petstore/models/special_model_name' -require 'petstore/models/tag' -require 'petstore/models/user' - -# APIs -require 'petstore/api/another_fake_api' -require 'petstore/api/default_api' -require 'petstore/api/fake_api' -require 'petstore/api/fake_classname_tags123_api' -require 'petstore/api/pet_api' -require 'petstore/api/store_api' -require 'petstore/api/user_api' - -module Petstore - class << self - # Customize default settings for the SDK using block. - # Petstore.configure do |config| - # config.username = "xxx" - # config.password = "xxx" - # end - # If no block given, return the default Configuration object. - def configure - if block_given? - yield(Configuration.default) - else - Configuration.default - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb deleted file mode 100644 index dfa6972327d2..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ /dev/null @@ -1,86 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class AnotherFakeApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # To test special tags - # To test special tags and operation ID starting with number - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Client] - def call_123_test_special_tags(client, opts = {}) - data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts) - data - end - - # To test special tags - # To test special tags and operation ID starting with number - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def call_123_test_special_tags_with_http_info(client, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' - end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags" - end - # resource path - local_var_path = '/another-fake/dummy' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(client) - - # return_type - return_type = opts[:return_type] || 'Client' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AnotherFakeApi#call_123_test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb deleted file mode 100644 index 3117e4bca528..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ /dev/null @@ -1,1142 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class FakeApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Health check endpoint - # @param [Hash] opts the optional parameters - # @return [HealthCheckResult] - def fake_health_get(opts = {}) - data, _status_code, _headers = fake_health_get_with_http_info(opts) - data - end - - # Health check endpoint - # @param [Hash] opts the optional parameters - # @return [Array<(HealthCheckResult, Integer, Hash)>] HealthCheckResult data, response status code and response headers - def fake_health_get_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_health_get ...' - end - # resource path - local_var_path = '/fake/health' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HealthCheckResult' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [nil] - def fake_http_signature_test(pet, opts = {}) - fake_http_signature_test_with_http_info(pet, opts) - nil - end - - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def fake_http_signature_test_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" - end - # resource path - local_var_path = '/fake/http-signature-test' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) - header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['http_signature_test'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Test serialization of outer boolean types - # @param [Hash] opts the optional parameters - # @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) - data - end - - # Test serialization of outer boolean types - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :body Input boolean as post body - # @return [Array<(Boolean, Integer, Hash)>] Boolean data, response status code and response headers - def fake_outer_boolean_serialize_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_boolean_serialize ...' - end - # resource path - local_var_path = '/fake/outer/boolean' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) - - # return_type - return_type = opts[:return_type] || 'Boolean' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_outer_boolean_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Test serialization of object with outer number type - # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body - # @return [OuterComposite] - def fake_outer_composite_serialize(opts = {}) - data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) - data - end - - # Test serialization of object with outer number type - # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body - # @return [Array<(OuterComposite, Integer, Hash)>] OuterComposite data, response status code and response headers - def fake_outer_composite_serialize_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_composite_serialize ...' - end - # resource path - local_var_path = '/fake/outer/composite' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'outer_composite']) - - # return_type - return_type = opts[:return_type] || 'OuterComposite' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_outer_composite_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Test serialization of outer number types - # @param [Hash] opts the optional parameters - # @option opts [Float] :body Input number as post body - # @return [Float] - def fake_outer_number_serialize(opts = {}) - data, _status_code, _headers = fake_outer_number_serialize_with_http_info(opts) - data - end - - # Test serialization of outer number types - # @param [Hash] opts the optional parameters - # @option opts [Float] :body Input number as post body - # @return [Array<(Float, Integer, Hash)>] Float data, response status code and response headers - def fake_outer_number_serialize_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_number_serialize ...' - end - # resource path - local_var_path = '/fake/outer/number' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) - - # return_type - return_type = opts[:return_type] || 'Float' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_outer_number_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Test serialization of outer string types - # @param [Hash] opts the optional parameters - # @option opts [String] :body Input string as post body - # @return [String] - def fake_outer_string_serialize(opts = {}) - data, _status_code, _headers = fake_outer_string_serialize_with_http_info(opts) - data - end - - # Test serialization of outer string types - # @param [Hash] opts the optional parameters - # @option opts [String] :body Input string as post body - # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers - def fake_outer_string_serialize_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_string_serialize ...' - end - # resource path - local_var_path = '/fake/outer/string' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) - - # return_type - return_type = opts[:return_type] || 'String' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_outer_string_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class [FileSchemaTestClass] - # @param [Hash] opts the optional parameters - # @return [nil] - def test_body_with_file_schema(file_schema_test_class, opts = {}) - test_body_with_file_schema_with_http_info(file_schema_test_class, opts) - nil - end - - # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class [FileSchemaTestClass] - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...' - end - # verify the required parameter 'file_schema_test_class' is set - if @api_client.config.client_side_validation && file_schema_test_class.nil? - fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema" - end - # resource path - local_var_path = '/fake/body-with-file-schema' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(file_schema_test_class) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_body_with_file_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param query [String] - # @param user [User] - # @param [Hash] opts the optional parameters - # @return [nil] - def test_body_with_query_params(query, user, opts = {}) - test_body_with_query_params_with_http_info(query, user, opts) - nil - end - - # @param query [String] - # @param user [User] - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_body_with_query_params_with_http_info(query, user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...' - end - # verify the required parameter 'query' is set - if @api_client.config.client_side_validation && query.nil? - fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params" - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params" - end - # resource path - local_var_path = '/fake/body-with-query-params' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'query'] = query - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_body_with_query_params\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # To test \"client\" model - # To test \"client\" model - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Client] - def test_client_model(client, opts = {}) - data, _status_code, _headers = test_client_model_with_http_info(client, opts) - data - end - - # To test \"client\" model - # To test \"client\" model - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def test_client_model_with_http_info(client, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...' - end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model" - end - # resource path - local_var_path = '/fake' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(client) - - # return_type - return_type = opts[:return_type] || 'Client' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_client_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # @param number [Float] None - # @param double [Float] None - # @param pattern_without_delimiter [String] None - # @param byte [String] None - # @param [Hash] opts the optional parameters - # @option opts [Integer] :integer None - # @option opts [Integer] :int32 None - # @option opts [Integer] :int64 None - # @option opts [Float] :float None - # @option opts [String] :string None - # @option opts [File] :binary None - # @option opts [Date] :date None - # @option opts [DateTime] :date_time None - # @option opts [String] :password None - # @option opts [String] :callback None - # @return [nil] - def test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts = {}) - test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts) - nil - end - - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # @param number [Float] None - # @param double [Float] None - # @param pattern_without_delimiter [String] None - # @param byte [String] None - # @param [Hash] opts the optional parameters - # @option opts [Integer] :integer None - # @option opts [Integer] :int32 None - # @option opts [Integer] :int64 None - # @option opts [Float] :float None - # @option opts [String] :string None - # @option opts [File] :binary None - # @option opts [Date] :date None - # @option opts [DateTime] :date_time None - # @option opts [String] :password None - # @option opts [String] :callback None - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_endpoint_parameters ...' - end - # verify the required parameter 'number' is set - if @api_client.config.client_side_validation && number.nil? - fail ArgumentError, "Missing the required parameter 'number' when calling FakeApi.test_endpoint_parameters" - end - if @api_client.config.client_side_validation && number > 543.2 - fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 543.2.' - end - - if @api_client.config.client_side_validation && number < 32.1 - fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 32.1.' - end - - # verify the required parameter 'double' is set - if @api_client.config.client_side_validation && double.nil? - fail ArgumentError, "Missing the required parameter 'double' when calling FakeApi.test_endpoint_parameters" - end - if @api_client.config.client_side_validation && double > 123.4 - fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 123.4.' - end - - if @api_client.config.client_side_validation && double < 67.8 - fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 67.8.' - end - - # verify the required parameter 'pattern_without_delimiter' is set - if @api_client.config.client_side_validation && pattern_without_delimiter.nil? - fail ArgumentError, "Missing the required parameter 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters" - end - pattern = Regexp.new(/^[A-Z].*/) - if @api_client.config.client_side_validation && pattern_without_delimiter !~ pattern - fail ArgumentError, "invalid value for 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}." - end - - # verify the required parameter 'byte' is set - if @api_client.config.client_side_validation && byte.nil? - fail ArgumentError, "Missing the required parameter 'byte' when calling FakeApi.test_endpoint_parameters" - end - if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] > 100 - fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.' - end - - if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] < 10 - fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.' - end - - if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] > 200 - fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.' - end - - if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] < 20 - fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.' - end - - if @api_client.config.client_side_validation && !opts[:'float'].nil? && opts[:'float'] > 987.6 - fail ArgumentError, 'invalid value for "opts[:"float"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 987.6.' - end - - pattern = Regexp.new(/[a-z]/i) - if @api_client.config.client_side_validation && !opts[:'string'].nil? && opts[:'string'] !~ pattern - fail ArgumentError, "invalid value for 'opts[:\"string\"]' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}." - end - - if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length > 64 - fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be smaller than or equal to 64.' - end - - if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length < 10 - fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be great than or equal to 10.' - end - - # resource path - local_var_path = '/fake' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['number'] = number - form_params['double'] = double - form_params['pattern_without_delimiter'] = pattern_without_delimiter - form_params['byte'] = byte - form_params['integer'] = opts[:'integer'] if !opts[:'integer'].nil? - form_params['int32'] = opts[:'int32'] if !opts[:'int32'].nil? - form_params['int64'] = opts[:'int64'] if !opts[:'int64'].nil? - form_params['float'] = opts[:'float'] if !opts[:'float'].nil? - form_params['string'] = opts[:'string'] if !opts[:'string'].nil? - form_params['binary'] = opts[:'binary'] if !opts[:'binary'].nil? - form_params['date'] = opts[:'date'] if !opts[:'date'].nil? - form_params['dateTime'] = opts[:'date_time'] if !opts[:'date_time'].nil? - form_params['password'] = opts[:'password'] if !opts[:'password'].nil? - form_params['callback'] = opts[:'callback'] if !opts[:'callback'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['http_basic_test'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_endpoint_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # To test enum parameters - # 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 [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 [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) (default to '$') - # @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) - nil - end - - # To test enum parameters - # 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) - # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) - # @option opts [String] :enum_query_string Query parameter enum test (string) - # @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) - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_enum_parameters_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_enum_parameters ...' - end - allowable_values = [">", "$"] - if @api_client.config.client_side_validation && opts[:'enum_header_string_array'] && !opts[:'enum_header_string_array'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"enum_header_string_array\", must include one of #{allowable_values}" - end - allowable_values = ["_abc", "-efg", "(xyz)"] - if @api_client.config.client_side_validation && opts[:'enum_header_string'] && !allowable_values.include?(opts[:'enum_header_string']) - fail ArgumentError, "invalid value for \"enum_header_string\", must be one of #{allowable_values}" - end - allowable_values = [">", "$"] - if @api_client.config.client_side_validation && opts[:'enum_query_string_array'] && !opts[:'enum_query_string_array'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"enum_query_string_array\", must include one of #{allowable_values}" - end - allowable_values = ["_abc", "-efg", "(xyz)"] - if @api_client.config.client_side_validation && opts[:'enum_query_string'] && !allowable_values.include?(opts[:'enum_query_string']) - fail ArgumentError, "invalid value for \"enum_query_string\", must be one of #{allowable_values}" - end - allowable_values = [1, -2] - if @api_client.config.client_side_validation && opts[:'enum_query_integer'] && !allowable_values.include?(opts[:'enum_query_integer']) - fail ArgumentError, "invalid value for \"enum_query_integer\", must be one of #{allowable_values}" - end - allowable_values = [1.1, -1.2] - if @api_client.config.client_side_validation && opts[:'enum_query_double'] && !allowable_values.include?(opts[:'enum_query_double']) - fail ArgumentError, "invalid value for \"enum_query_double\", must be one of #{allowable_values}" - end - allowable_values = [">", "$"] - if @api_client.config.client_side_validation && opts[:'enum_form_string_array'] && !opts[:'enum_form_string_array'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"enum_form_string_array\", must include one of #{allowable_values}" - end - allowable_values = ["_abc", "-efg", "(xyz)"] - if @api_client.config.client_side_validation && opts[:'enum_form_string'] && !allowable_values.include?(opts[:'enum_form_string']) - fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/fake' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'enum_query_string_array'] = @api_client.build_collection_param(opts[:'enum_query_string_array'], :multi) if !opts[:'enum_query_string_array'].nil? - query_params[:'enum_query_string'] = opts[:'enum_query_string'] if !opts[:'enum_query_string'].nil? - query_params[:'enum_query_integer'] = opts[:'enum_query_integer'] if !opts[:'enum_query_integer'].nil? - query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - header_params[:'enum_header_string_array'] = @api_client.build_collection_param(opts[:'enum_header_string_array'], :csv) if !opts[:'enum_header_string_array'].nil? - header_params[:'enum_header_string'] = opts[:'enum_header_string'] if !opts[:'enum_header_string'].nil? - - # form parameters - form_params = opts[:form_params] || {} - form_params['enum_form_string_array'] = @api_client.build_collection_param(opts[:'enum_form_string_array'], :csv) if !opts[:'enum_form_string_array'].nil? - form_params['enum_form_string'] = opts[:'enum_form_string'] if !opts[:'enum_form_string'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_enum_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Fake endpoint to test group parameters (optional) - # Fake endpoint to test group parameters (optional) - # @param required_string_group [Integer] Required String in group parameters - # @param required_boolean_group [Boolean] Required Boolean in group parameters - # @param required_int64_group [Integer] Required Integer in group parameters - # @param [Hash] opts the optional parameters - # @option opts [Integer] :string_group String in group parameters - # @option opts [Boolean] :boolean_group Boolean in group parameters - # @option opts [Integer] :int64_group Integer in group parameters - # @return [nil] - def test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts = {}) - test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts) - nil - end - - # Fake endpoint to test group parameters (optional) - # Fake endpoint to test group parameters (optional) - # @param required_string_group [Integer] Required String in group parameters - # @param required_boolean_group [Boolean] Required Boolean in group parameters - # @param required_int64_group [Integer] Required Integer in group parameters - # @param [Hash] opts the optional parameters - # @option opts [Integer] :string_group String in group parameters - # @option opts [Boolean] :boolean_group Boolean in group parameters - # @option opts [Integer] :int64_group Integer in group parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_group_parameters ...' - end - # verify the required parameter 'required_string_group' is set - if @api_client.config.client_side_validation && required_string_group.nil? - fail ArgumentError, "Missing the required parameter 'required_string_group' when calling FakeApi.test_group_parameters" - end - # verify the required parameter 'required_boolean_group' is set - if @api_client.config.client_side_validation && required_boolean_group.nil? - fail ArgumentError, "Missing the required parameter 'required_boolean_group' when calling FakeApi.test_group_parameters" - end - # verify the required parameter 'required_int64_group' is set - if @api_client.config.client_side_validation && required_int64_group.nil? - fail ArgumentError, "Missing the required parameter 'required_int64_group' when calling FakeApi.test_group_parameters" - end - # resource path - local_var_path = '/fake' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'required_string_group'] = required_string_group - query_params[:'required_int64_group'] = required_int64_group - query_params[:'string_group'] = opts[:'string_group'] if !opts[:'string_group'].nil? - query_params[:'int64_group'] = opts[:'int64_group'] if !opts[:'int64_group'].nil? - - # header parameters - header_params = opts[:header_params] || {} - header_params[:'required_boolean_group'] = required_boolean_group - header_params[:'boolean_group'] = opts[:'boolean_group'] if !opts[:'boolean_group'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['bearer_test'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_group_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # test inline additionalProperties - # @param request_body [Hash] request body - # @param [Hash] opts the optional parameters - # @return [nil] - def test_inline_additional_properties(request_body, opts = {}) - test_inline_additional_properties_with_http_info(request_body, opts) - nil - end - - # test inline additionalProperties - # @param request_body [Hash] request body - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_inline_additional_properties_with_http_info(request_body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...' - end - # verify the required parameter 'request_body' is set - if @api_client.config.client_side_validation && request_body.nil? - fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties" - end - # resource path - local_var_path = '/fake/inline-additionalProperties' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(request_body) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_inline_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # test json serialization of form data - # @param param [String] field1 - # @param param2 [String] 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) - nil - end - - # test json serialization of form data - # @param param [String] field1 - # @param param2 [String] field2 - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, 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 = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['param'] = param - form_params['param2'] = param2 - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - 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 - - # To test the collection format in query parameters - # @param pipe [Array] - # @param ioutil [Array] - # @param http [Array] - # @param url [Array] - # @param context [Array] - # @param [Hash] opts the optional parameters - # @return [nil] - def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) - test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) - nil - end - - # To test the collection format in query parameters - # @param pipe [Array] - # @param ioutil [Array] - # @param http [Array] - # @param url [Array] - # @param context [Array] - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' - end - # verify the required parameter 'pipe' is set - if @api_client.config.client_side_validation && pipe.nil? - fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" - end - # verify the required parameter 'ioutil' is set - if @api_client.config.client_side_validation && ioutil.nil? - fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" - end - # verify the required parameter 'http' is set - if @api_client.config.client_side_validation && http.nil? - fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" - end - # verify the required parameter 'url' is set - if @api_client.config.client_side_validation && url.nil? - fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" - end - # verify the required parameter 'context' is set - if @api_client.config.client_side_validation && context.nil? - fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" - end - # resource path - local_var_path = '/fake/test-query-paramters' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'pipe'] = @api_client.build_collection_param(pipe, :multi) - query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) - query_params[:'http'] = @api_client.build_collection_param(http, :space) - query_params[:'url'] = @api_client.build_collection_param(url, :csv) - query_params[:'context'] = @api_client.build_collection_param(context, :multi) - - # header parameters - header_params = opts[:header_params] || {} - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb deleted file mode 100644 index 1e44496d5f82..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ /dev/null @@ -1,86 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class FakeClassnameTags123Api - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # To test class name in snake case - # To test class name in snake case - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Client] - def test_classname(client, opts = {}) - data, _status_code, _headers = test_classname_with_http_info(client, opts) - data - end - - # To test class name in snake case - # To test class name in snake case - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def test_classname_with_http_info(client, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...' - end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname" - end - # resource path - local_var_path = '/fake_classname_test' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(client) - - # return_type - return_type = opts[:return_type] || 'Client' - - # auth_names - auth_names = opts[:auth_names] || ['api_key_query'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeClassnameTags123Api#test_classname\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb deleted file mode 100644 index 849945bcd6ec..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ /dev/null @@ -1,597 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class PetApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Add a new pet to the store - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [nil] - def add_pet(pet, opts = {}) - add_pet_with_http_info(pet, opts) - nil - end - - # Add a new pet to the store - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def add_pet_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet" - end - # resource path - local_var_path = '/pet' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#add_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Deletes a pet - # @param pet_id [Integer] Pet id to delete - # @param [Hash] opts the optional parameters - # @option opts [String] :api_key - # @return [nil] - def delete_pet(pet_id, opts = {}) - delete_pet_with_http_info(pet_id, opts) - nil - end - - # Deletes a pet - # @param pet_id [Integer] Pet id to delete - # @param [Hash] opts the optional parameters - # @option opts [String] :api_key - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_pet_with_http_info(pet_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.delete_pet ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" - end - # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - header_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#delete_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Finds Pets by status - # Multiple status values can be provided with comma separated strings - # @param status [Array] Status values that need to be considered for filter - # @param [Hash] opts the optional parameters - # @return [Array] - def find_pets_by_status(status, opts = {}) - data, _status_code, _headers = find_pets_by_status_with_http_info(status, opts) - data - end - - # Finds Pets by status - # Multiple status values can be provided with comma separated strings - # @param status [Array] Status values that need to be considered for filter - # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - def find_pets_by_status_with_http_info(status, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_status ...' - end - # verify the required parameter 'status' is set - if @api_client.config.client_side_validation && status.nil? - fail ArgumentError, "Missing the required parameter 'status' when calling PetApi.find_pets_by_status" - end - # resource path - local_var_path = '/pet/findByStatus' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'status'] = @api_client.build_collection_param(status, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Array' - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#find_pets_by_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Finds Pets by tags - # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - # @param tags [Array] Tags to filter by - # @param [Hash] opts the optional parameters - # @return [Array] - def find_pets_by_tags(tags, opts = {}) - data, _status_code, _headers = find_pets_by_tags_with_http_info(tags, opts) - data - end - - # Finds Pets by tags - # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - # @param tags [Array] Tags to filter by - # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - def find_pets_by_tags_with_http_info(tags, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_tags ...' - end - # verify the required parameter 'tags' is set - if @api_client.config.client_side_validation && tags.nil? - fail ArgumentError, "Missing the required parameter 'tags' when calling PetApi.find_pets_by_tags" - end - # resource path - local_var_path = '/pet/findByTags' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'tags'] = @api_client.build_collection_param(tags, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Array' - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#find_pets_by_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Find pet by ID - # Returns a single pet - # @param pet_id [Integer] ID of pet to return - # @param [Hash] opts the optional parameters - # @return [Pet] - def get_pet_by_id(pet_id, opts = {}) - data, _status_code, _headers = get_pet_by_id_with_http_info(pet_id, opts) - data - end - - # Find pet by ID - # Returns a single pet - # @param pet_id [Integer] ID of pet to return - # @param [Hash] opts the optional parameters - # @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers - def get_pet_by_id_with_http_info(pet_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.get_pet_by_id ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" - end - # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Pet' - - # auth_names - auth_names = opts[:auth_names] || ['api_key'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#get_pet_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update an existing pet - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [nil] - def update_pet(pet, opts = {}) - update_pet_with_http_info(pet, opts) - nil - end - - # Update an existing pet - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_pet_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet" - end - # resource path - local_var_path = '/pet' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#update_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Updates a pet in the store with form data - # @param pet_id [Integer] ID of pet that needs to be updated - # @param [Hash] opts the optional parameters - # @option opts [String] :name Updated name of the pet - # @option opts [String] :status Updated status of the pet - # @return [nil] - def update_pet_with_form(pet_id, opts = {}) - update_pet_with_form_with_http_info(pet_id, opts) - nil - end - - # Updates a pet in the store with form data - # @param pet_id [Integer] ID of pet that needs to be updated - # @param [Hash] opts the optional parameters - # @option opts [String] :name Updated name of the pet - # @option opts [String] :status Updated status of the pet - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_pet_with_form_with_http_info(pet_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.update_pet_with_form ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" - end - # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['name'] = opts[:'name'] if !opts[:'name'].nil? - form_params['status'] = opts[:'status'] if !opts[:'status'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#update_pet_with_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # uploads an image - # @param pet_id [Integer] ID of pet to update - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @option opts [File] :file file to upload - # @return [ApiResponse] - def upload_file(pet_id, opts = {}) - data, _status_code, _headers = upload_file_with_http_info(pet_id, opts) - data - end - - # uploads an image - # @param pet_id [Integer] ID of pet to update - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @option opts [File] :file file to upload - # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers - def upload_file_with_http_info(pet_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.upload_file ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" - end - # resource path - local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? - form_params['file'] = opts[:'file'] if !opts[:'file'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ApiResponse' - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # uploads an image (required) - # @param pet_id [Integer] ID of pet to update - # @param required_file [File] file to upload - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @return [ApiResponse] - def upload_file_with_required_file(pet_id, required_file, opts = {}) - data, _status_code, _headers = upload_file_with_required_file_with_http_info(pet_id, required_file, opts) - data - end - - # uploads an image (required) - # @param pet_id [Integer] ID of pet to update - # @param required_file [File] file to upload - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers - def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.upload_file_with_required_file ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file_with_required_file" - end - # verify the required parameter 'required_file' is set - if @api_client.config.client_side_validation && required_file.nil? - fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" - end - # resource path - local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['requiredFile'] = required_file - form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ApiResponse' - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#upload_file_with_required_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb deleted file mode 100644 index dafc7a71696c..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class StoreApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete purchase order by ID - # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - # @param order_id [String] ID of the order that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_order(order_id, opts = {}) - delete_order_with_http_info(order_id, opts) - nil - end - - # Delete purchase order by ID - # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - # @param order_id [String] ID of the order that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_order_with_http_info(order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StoreApi.delete_order ...' - end - # verify the required parameter 'order_id' is set - if @api_client.config.client_side_validation && order_id.nil? - fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" - end - # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: StoreApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Returns pet inventories by status - # Returns a map of status codes to quantities - # @param [Hash] opts the optional parameters - # @return [Hash] - def get_inventory(opts = {}) - data, _status_code, _headers = get_inventory_with_http_info(opts) - data - end - - # Returns pet inventories by status - # Returns a map of status codes to quantities - # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_inventory_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StoreApi.get_inventory ...' - end - # resource path - local_var_path = '/store/inventory' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Hash' - - # auth_names - auth_names = opts[:auth_names] || ['api_key'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: StoreApi#get_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Find purchase order by ID - # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - # @param order_id [Integer] ID of pet that needs to be fetched - # @param [Hash] opts the optional parameters - # @return [Order] - def get_order_by_id(order_id, opts = {}) - data, _status_code, _headers = get_order_by_id_with_http_info(order_id, opts) - data - end - - # Find purchase order by ID - # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - # @param order_id [Integer] ID of pet that needs to be fetched - # @param [Hash] opts the optional parameters - # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers - def get_order_by_id_with_http_info(order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StoreApi.get_order_by_id ...' - end - # verify the required parameter 'order_id' is set - if @api_client.config.client_side_validation && order_id.nil? - fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.get_order_by_id" - end - if @api_client.config.client_side_validation && order_id > 5 - fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be smaller than or equal to 5.' - end - - if @api_client.config.client_side_validation && order_id < 1 - fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be greater than or equal to 1.' - end - - # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Order' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: StoreApi#get_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Place an order for a pet - # @param order [Order] order placed for purchasing the pet - # @param [Hash] opts the optional parameters - # @return [Order] - def place_order(order, opts = {}) - data, _status_code, _headers = place_order_with_http_info(order, opts) - data - end - - # Place an order for a pet - # @param order [Order] order placed for purchasing the pet - # @param [Hash] opts the optional parameters - # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers - def place_order_with_http_info(order, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...' - end - # verify the required parameter 'order' is set - if @api_client.config.client_side_validation && order.nil? - fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order" - end - # resource path - local_var_path = '/store/order' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(order) - - # return_type - return_type = opts[:return_type] || 'Order' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: StoreApi#place_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb deleted file mode 100644 index 8e2dd2a11a25..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ /dev/null @@ -1,512 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class UserApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Create user - # This can only be done by the logged in user. - # @param user [User] Created user object - # @param [Hash] opts the optional parameters - # @return [nil] - def create_user(user, opts = {}) - create_user_with_http_info(user, opts) - nil - end - - # Create user - # This can only be done by the logged in user. - # @param user [User] Created user object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_user_with_http_info(user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.create_user ...' - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user" - end - # resource path - local_var_path = '/user' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Creates list of users with given input array - # @param user [Array] List of user object - # @param [Hash] opts the optional parameters - # @return [nil] - def create_users_with_array_input(user, opts = {}) - create_users_with_array_input_with_http_info(user, opts) - nil - end - - # Creates list of users with given input array - # @param user [Array] List of user object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_users_with_array_input_with_http_info(user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...' - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input" - end - # resource path - local_var_path = '/user/createWithArray' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#create_users_with_array_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Creates list of users with given input array - # @param user [Array] List of user object - # @param [Hash] opts the optional parameters - # @return [nil] - def create_users_with_list_input(user, opts = {}) - create_users_with_list_input_with_http_info(user, opts) - nil - end - - # Creates list of users with given input array - # @param user [Array] List of user object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_users_with_list_input_with_http_info(user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...' - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input" - end - # resource path - local_var_path = '/user/createWithList' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#create_users_with_list_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Delete user - # This can only be done by the logged in user. - # @param username [String] The name that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_user(username, opts = {}) - delete_user_with_http_info(username, opts) - nil - end - - # Delete user - # This can only be done by the logged in user. - # @param username [String] The name that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_user_with_http_info(username, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.delete_user ...' - end - # verify the required parameter 'username' is set - if @api_client.config.client_side_validation && username.nil? - fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" - end - # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get user by user name - # @param username [String] The name that needs to be fetched. Use user1 for testing. - # @param [Hash] opts the optional parameters - # @return [User] - def get_user_by_name(username, opts = {}) - data, _status_code, _headers = get_user_by_name_with_http_info(username, opts) - data - end - - # Get user by user name - # @param username [String] The name that needs to be fetched. Use user1 for testing. - # @param [Hash] opts the optional parameters - # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers - def get_user_by_name_with_http_info(username, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.get_user_by_name ...' - end - # verify the required parameter 'username' is set - if @api_client.config.client_side_validation && username.nil? - fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" - end - # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'User' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#get_user_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Logs user into the system - # @param username [String] The user name for login - # @param password [String] The password for login in clear text - # @param [Hash] opts the optional parameters - # @return [String] - def login_user(username, password, opts = {}) - data, _status_code, _headers = login_user_with_http_info(username, password, opts) - data - end - - # Logs user into the system - # @param username [String] The user name for login - # @param password [String] The password for login in clear text - # @param [Hash] opts the optional parameters - # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers - def login_user_with_http_info(username, password, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.login_user ...' - end - # verify the required parameter 'username' is set - if @api_client.config.client_side_validation && username.nil? - fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.login_user" - end - # verify the required parameter 'password' is set - if @api_client.config.client_side_validation && password.nil? - fail ArgumentError, "Missing the required parameter 'password' when calling UserApi.login_user" - end - # resource path - local_var_path = '/user/login' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'username'] = username - query_params[:'password'] = password - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'String' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#login_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Logs out current logged in user session - # @param [Hash] opts the optional parameters - # @return [nil] - def logout_user(opts = {}) - logout_user_with_http_info(opts) - nil - end - - # Logs out current logged in user session - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def logout_user_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.logout_user ...' - end - # resource path - local_var_path = '/user/logout' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#logout_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Updated user - # This can only be done by the logged in user. - # @param username [String] name that need to be deleted - # @param user [User] Updated user object - # @param [Hash] opts the optional parameters - # @return [nil] - def update_user(username, user, opts = {}) - update_user_with_http_info(username, user, opts) - nil - end - - # Updated user - # This can only be done by the logged in user. - # @param username [String] name that need to be deleted - # @param user [User] Updated user object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_user_with_http_info(username, user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.update_user ...' - end - # verify the required parameter 'username' is set - if @api_client.config.client_side_validation && username.nil? - fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user" - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" - end - # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb deleted file mode 100644 index 073625bf0bc3..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ /dev/null @@ -1,404 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'faraday' - -module Petstore - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - ssl_options = { - :ca_file => @config.ssl_ca_file, - :verify => @config.ssl_verify, - :verify_mode => @config.ssl_verify_mode, - :client_cert => @config.ssl_client_cert, - :client_key => @config.ssl_client_key - } - - connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| - conn.basic_auth(config.username, config.password) - if opts[:header_params]["Content-Type"] == "multipart/form-data" - conn.request :multipart - conn.request :url_encoded - end - conn.adapter(Faraday.default_adapter) - end - - begin - response = connection.public_send(http_method.to_sym.downcase) do |req| - build_request(http_method, path, req, opts) - end - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.status == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.status, - :response_headers => response.headers, - :response_body => response.body), - response.reason_phrase - end - end - rescue Faraday::TimeoutError - fail ApiError.new('Connection timed out') - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.status, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, request, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - update_params_for_auth! header_params, query_params, opts[:auth_names] - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :verbose => @config.debugging - } - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - request.headers = header_params - request.body = req_body - request.url url - request.params = query_params - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' - data = URI.encode_www_form(form_params) - elsif header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Tempfile - # TODO hardcode to application/octet-stream, need better way to detect content type - data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) - when ::Array, nil - # let Faraday handle Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - Petstore.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @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 - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb deleted file mode 100644 index 337c5c7002c9..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ /dev/null @@ -1,57 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -module Petstore - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb deleted file mode 100644 index a98fb5c45bd1..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ /dev/null @@ -1,305 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -module Petstore - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :ssl_verify - - ### TLS/SSL setting - # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - attr_accessor :ssl_verify_mode - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - attr_accessor :ssl_ca_file - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :ssl_client_cert - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :ssl_client_key - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'http' - @host = 'petstore.swagger.io' - @base_path = '/v2' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @ssl_verify = true - @ssl_verify_mode = nil - @ssl_ca_file = nil - @ssl_client_cert = nil - @ssl_client_key = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - 'api_key' => - { - type: 'api_key', - in: 'header', - key: 'api_key', - value: api_key_with_prefix('api_key') - }, - 'api_key_query' => - { - type: 'api_key', - in: 'query', - key: 'api_key_query', - value: api_key_with_prefix('api_key_query') - }, - 'bearer_test' => - { - type: 'bearer', - in: 'header', - format: 'JWT', - key: 'Authorization', - value: "Bearer #{access_token}" - }, - 'http_basic_test' => - { - type: 'basic', - in: 'header', - key: 'Authorization', - value: basic_auth_token - }, - 'petstore_auth' => - { - type: 'oauth2', - in: 'header', - key: 'Authorization', - value: "Bearer #{access_token}" - }, - } - end - - # Returns an array of Server setting - def server_settings - [ - { - url: "http://{server}.swagger.io:{port}/v2", - description: "petstore server", - variables: { - server: { - description: "No description provided", - default_value: "petstore", - enum_values: [ - "petstore", - "qa-petstore", - "dev-petstore" - ] - }, - port: { - description: "No description provided", - default_value: "80", - enum_values: [ - "80", - "8080" - ] - } - } - }, - { - url: "https://localhost:8080/{version}", - description: "The local server", - variables: { - version: { - description: "No description provided", - default_value: "v2", - enum_values: [ - "v1", - "v2" - ] - } - } - } - ] - end - - # Returns URL based on server settings - # - # @param index array index of the server settings - # @param variables hash of variable and the corresponding value - def server_url(index, variables = {}) - servers = server_settings - - # check array index out of bound - if (index < 0 || index >= servers.size) - fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" - end - - server = servers[index] - url = server[:url] - - # go through variable and assign a value - server[:variables].each do |name, variable| - if variables.key?(name) - if (server[:variables][name][:enum_values].include? variables[name]) - url.gsub! "{" + name.to_s + "}", variables[name] - else - fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." - end - else - # use default value - url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] - end - end - - url - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb deleted file mode 100644 index 2e353ef8e464..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesClass - attr_accessor :map_property - - attr_accessor :map_of_map_property - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'map_property' => :'map_property', - :'map_of_map_property' => :'map_of_map_property' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'map_property' => :'Hash', - :'map_of_map_property' => :'Hash>' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesClass` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'map_property') - if (value = attributes[:'map_property']).is_a?(Hash) - self.map_property = value - end - end - - if attributes.key?(:'map_of_map_property') - if (value = attributes[:'map_of_map_property']).is_a?(Hash) - self.map_of_map_property = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - map_property == o.map_property && - map_of_map_property == o.map_of_map_property - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [map_property, map_of_map_property].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb deleted file mode 100644 index 55b0741b47f5..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Animal - attr_accessor :class_name - - attr_accessor :color - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'class_name' => :'className', - :'color' => :'color' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'class_name' => :'String', - :'color' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # discriminator's property name in OpenAPI v3 - def self.openapi_discriminator_name - :'class_name' - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Animal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'class_name') - self.class_name = attributes[:'class_name'] - end - - if attributes.key?(:'color') - self.color = attributes[:'color'] - else - self.color = 'red' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @class_name.nil? - invalid_properties.push('invalid value for "class_name", class_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @class_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - class_name == o.class_name && - color == o.color - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [class_name, color].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb deleted file mode 100644 index eb3fd03a63cb..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ApiResponse - attr_accessor :code - - attr_accessor :type - - attr_accessor :message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'type' => :'type', - :'message' => :'message' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Integer', - :'type' => :'String', - :'message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ApiResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - type == o.type && - message == o.message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, type, message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb deleted file mode 100644 index 1348124c720f..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ /dev/null @@ -1,208 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ArrayOfArrayOfNumberOnly - attr_accessor :array_array_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'array_array_number' => :'ArrayArrayNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'array_array_number' => :'Array>' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfArrayOfNumberOnly` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'array_array_number') - if (value = attributes[:'array_array_number']).is_a?(Array) - self.array_array_number = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - array_array_number == o.array_array_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [array_array_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb deleted file mode 100644 index 8ea8dff8ffaf..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ /dev/null @@ -1,208 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ArrayOfNumberOnly - attr_accessor :array_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'array_number' => :'ArrayNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'array_number' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfNumberOnly` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'array_number') - if (value = attributes[:'array_number']).is_a?(Array) - self.array_number = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - array_number == o.array_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [array_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb deleted file mode 100644 index 7f3e302da040..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ArrayTest - attr_accessor :array_of_string - - attr_accessor :array_array_of_integer - - attr_accessor :array_array_of_model - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'array_of_string' => :'array_of_string', - :'array_array_of_integer' => :'array_array_of_integer', - :'array_array_of_model' => :'array_array_of_model' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'array_of_string' => :'Array', - :'array_array_of_integer' => :'Array>', - :'array_array_of_model' => :'Array>' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayTest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'array_of_string') - if (value = attributes[:'array_of_string']).is_a?(Array) - self.array_of_string = value - end - end - - if attributes.key?(:'array_array_of_integer') - if (value = attributes[:'array_array_of_integer']).is_a?(Array) - self.array_array_of_integer = value - end - end - - if attributes.key?(:'array_array_of_model') - if (value = attributes[:'array_array_of_model']).is_a?(Array) - self.array_array_of_model = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - array_of_string == o.array_of_string && - array_array_of_integer == o.array_array_of_integer && - array_array_of_model == o.array_array_of_model - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [array_of_string, array_array_of_integer, array_array_of_model].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb deleted file mode 100644 index 6d2a185d4086..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Capitalization - attr_accessor :small_camel - - attr_accessor :capital_camel - - attr_accessor :small_snake - - attr_accessor :capital_snake - - attr_accessor :sca_eth_flow_points - - # Name of the pet - attr_accessor :att_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'small_camel' => :'smallCamel', - :'capital_camel' => :'CapitalCamel', - :'small_snake' => :'small_Snake', - :'capital_snake' => :'Capital_Snake', - :'sca_eth_flow_points' => :'SCA_ETH_Flow_Points', - :'att_name' => :'ATT_NAME' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'small_camel' => :'String', - :'capital_camel' => :'String', - :'small_snake' => :'String', - :'capital_snake' => :'String', - :'sca_eth_flow_points' => :'String', - :'att_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Capitalization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'small_camel') - self.small_camel = attributes[:'small_camel'] - end - - if attributes.key?(:'capital_camel') - self.capital_camel = attributes[:'capital_camel'] - end - - if attributes.key?(:'small_snake') - self.small_snake = attributes[:'small_snake'] - end - - if attributes.key?(:'capital_snake') - self.capital_snake = attributes[:'capital_snake'] - end - - if attributes.key?(:'sca_eth_flow_points') - self.sca_eth_flow_points = attributes[:'sca_eth_flow_points'] - end - - if attributes.key?(:'att_name') - self.att_name = attributes[:'att_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - small_camel == o.small_camel && - capital_camel == o.capital_camel && - small_snake == o.small_snake && - capital_snake == o.capital_snake && - sca_eth_flow_points == o.sca_eth_flow_points && - att_name == o.att_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [small_camel, capital_camel, small_snake, capital_snake, sca_eth_flow_points, att_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb deleted file mode 100644 index edc40a27fc3a..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Cat < Animal - attr_accessor :declawed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'declawed' => :'declawed' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'declawed' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Animal', - :'CatAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Cat` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'declawed') - self.declawed = attributes[:'declawed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true && super - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - declawed == o.declawed && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [declawed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb deleted file mode 100644 index ec0963e95123..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class CatAllOf - attr_accessor :declawed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'declawed' => :'declawed' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'declawed' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::CatAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::CatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'declawed') - self.declawed = attributes[:'declawed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - declawed == o.declawed - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [declawed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb deleted file mode 100644 index 7a2e43d80871..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Category - attr_accessor :id - - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Category` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - else - self.name = 'default-name' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb deleted file mode 100644 index c67cb4e2db8a..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ /dev/null @@ -1,207 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Model for testing model with \"_class\" property - class ClassModel - attr_accessor :_class - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_class' => :'_class' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_class' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ClassModel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_class') - self._class = attributes[:'_class'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _class == o._class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_class].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb deleted file mode 100644 index fb11d2a9f046..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Client - attr_accessor :client - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client' => :'client' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'client' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Client` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client') - self.client = attributes[:'client'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client == o.client - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb deleted file mode 100644 index e463e0dcd1ec..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Dog < Animal - attr_accessor :breed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'breed' => :'breed' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'breed' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Animal', - :'DogAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Dog` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'breed') - self.breed = attributes[:'breed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true && super - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - breed == o.breed && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [breed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb deleted file mode 100644 index afaf911b6c21..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class DogAllOf - attr_accessor :breed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'breed' => :'breed' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'breed' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::DogAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DogAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'breed') - self.breed = attributes[:'breed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - breed == o.breed - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [breed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb deleted file mode 100644 index de2ea593e9e2..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class EnumArrays - attr_accessor :just_symbol - - attr_accessor :array_enum - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'just_symbol' => :'just_symbol', - :'array_enum' => :'array_enum' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'just_symbol' => :'String', - :'array_enum' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumArrays` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'just_symbol') - self.just_symbol = attributes[:'just_symbol'] - end - - if attributes.key?(:'array_enum') - if (value = attributes[:'array_enum']).is_a?(Array) - self.array_enum = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - just_symbol_validator = EnumAttributeValidator.new('String', [">=", "$"]) - return false unless just_symbol_validator.valid?(@just_symbol) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] just_symbol Object to be assigned - def just_symbol=(just_symbol) - validator = EnumAttributeValidator.new('String', [">=", "$"]) - unless validator.valid?(just_symbol) - fail ArgumentError, "invalid value for \"just_symbol\", must be one of #{validator.allowable_values}." - end - @just_symbol = just_symbol - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - just_symbol == o.just_symbol && - array_enum == o.array_enum - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [just_symbol, array_enum].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb deleted file mode 100644 index 69fcebec615b..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ /dev/null @@ -1,37 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class EnumClass - 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 self.build_from_hash(value) - new.build_from_hash(value) - end - - # 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) - constantValues = EnumClass.constants.select { |c| EnumClass::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #EnumClass" if constantValues.empty? - value - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb deleted file mode 100644 index 473d7994ad6d..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ /dev/null @@ -1,345 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class EnumTest - attr_accessor :enum_string - - attr_accessor :enum_string_required - - attr_accessor :enum_integer - - attr_accessor :enum_number - - attr_accessor :outer_enum - - attr_accessor :outer_enum_integer - - attr_accessor :outer_enum_default_value - - attr_accessor :outer_enum_integer_default_value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enum_string' => :'enum_string', - :'enum_string_required' => :'enum_string_required', - :'enum_integer' => :'enum_integer', - :'enum_number' => :'enum_number', - :'outer_enum' => :'outerEnum', - :'outer_enum_integer' => :'outerEnumInteger', - :'outer_enum_default_value' => :'outerEnumDefaultValue', - :'outer_enum_integer_default_value' => :'outerEnumIntegerDefaultValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'enum_string' => :'String', - :'enum_string_required' => :'String', - :'enum_integer' => :'Integer', - :'enum_number' => :'Float', - :'outer_enum' => :'OuterEnum', - :'outer_enum_integer' => :'OuterEnumInteger', - :'outer_enum_default_value' => :'OuterEnumDefaultValue', - :'outer_enum_integer_default_value' => :'OuterEnumIntegerDefaultValue' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'outer_enum', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumTest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enum_string') - self.enum_string = attributes[:'enum_string'] - end - - if attributes.key?(:'enum_string_required') - self.enum_string_required = attributes[:'enum_string_required'] - end - - if attributes.key?(:'enum_integer') - self.enum_integer = attributes[:'enum_integer'] - end - - if attributes.key?(:'enum_number') - self.enum_number = attributes[:'enum_number'] - end - - if attributes.key?(:'outer_enum') - self.outer_enum = attributes[:'outer_enum'] - end - - if attributes.key?(:'outer_enum_integer') - self.outer_enum_integer = attributes[:'outer_enum_integer'] - end - - if attributes.key?(:'outer_enum_default_value') - self.outer_enum_default_value = attributes[:'outer_enum_default_value'] - end - - if attributes.key?(:'outer_enum_integer_default_value') - self.outer_enum_integer_default_value = attributes[:'outer_enum_integer_default_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @enum_string_required.nil? - invalid_properties.push('invalid value for "enum_string_required", enum_string_required cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - enum_string_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - return false unless enum_string_validator.valid?(@enum_string) - return false if @enum_string_required.nil? - enum_string_required_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - return false unless enum_string_required_validator.valid?(@enum_string_required) - enum_integer_validator = EnumAttributeValidator.new('Integer', [1, -1]) - return false unless enum_integer_validator.valid?(@enum_integer) - enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) - return false unless enum_number_validator.valid?(@enum_number) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_string Object to be assigned - def enum_string=(enum_string) - validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - unless validator.valid?(enum_string) - fail ArgumentError, "invalid value for \"enum_string\", must be one of #{validator.allowable_values}." - end - @enum_string = enum_string - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_string_required Object to be assigned - def enum_string_required=(enum_string_required) - validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - unless validator.valid?(enum_string_required) - fail ArgumentError, "invalid value for \"enum_string_required\", must be one of #{validator.allowable_values}." - end - @enum_string_required = enum_string_required - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_integer Object to be assigned - def enum_integer=(enum_integer) - validator = EnumAttributeValidator.new('Integer', [1, -1]) - unless validator.valid?(enum_integer) - fail ArgumentError, "invalid value for \"enum_integer\", must be one of #{validator.allowable_values}." - end - @enum_integer = enum_integer - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_number Object to be assigned - def enum_number=(enum_number) - validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) - unless validator.valid?(enum_number) - fail ArgumentError, "invalid value for \"enum_number\", must be one of #{validator.allowable_values}." - end - @enum_number = enum_number - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enum_string == o.enum_string && - enum_string_required == o.enum_string_required && - enum_integer == o.enum_integer && - enum_number == o.enum_number && - outer_enum == o.outer_enum && - outer_enum_integer == o.outer_enum_integer && - outer_enum_default_value == o.outer_enum_default_value && - outer_enum_integer_default_value == o.outer_enum_integer_default_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enum_string, enum_string_required, enum_integer, enum_number, outer_enum, outer_enum_integer, outer_enum_default_value, outer_enum_integer_default_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb deleted file mode 100644 index ae55f5eb63e1..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ /dev/null @@ -1,208 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Must be named `File` for test. - class File - # Test capitalization - attr_accessor :source_uri - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'source_uri' => :'sourceURI' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'source_uri' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::File` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'source_uri') - self.source_uri = attributes[:'source_uri'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - source_uri == o.source_uri - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [source_uri].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb deleted file mode 100644 index 8291d10e6ac5..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class FileSchemaTestClass - attr_accessor :file - - attr_accessor :files - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'file' => :'file', - :'files' => :'files' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'file' => :'File', - :'files' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FileSchemaTestClass` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'file') - self.file = attributes[:'file'] - end - - if attributes.key?(:'files') - if (value = attributes[:'files']).is_a?(Array) - self.files = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - file == o.file && - files == o.files - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [file, files].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb deleted file mode 100644 index d39e9c915806..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ /dev/null @@ -1,557 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class FormatTest - attr_accessor :integer - - attr_accessor :int32 - - attr_accessor :int64 - - attr_accessor :number - - attr_accessor :float - - attr_accessor :double - - attr_accessor :string - - attr_accessor :byte - - attr_accessor :binary - - attr_accessor :date - - attr_accessor :date_time - - attr_accessor :uuid - - attr_accessor :password - - # A string that is a 10 digit number. Can have leading zeros. - attr_accessor :pattern_with_digits - - # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - attr_accessor :pattern_with_digits_and_delimiter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'integer' => :'integer', - :'int32' => :'int32', - :'int64' => :'int64', - :'number' => :'number', - :'float' => :'float', - :'double' => :'double', - :'string' => :'string', - :'byte' => :'byte', - :'binary' => :'binary', - :'date' => :'date', - :'date_time' => :'dateTime', - :'uuid' => :'uuid', - :'password' => :'password', - :'pattern_with_digits' => :'pattern_with_digits', - :'pattern_with_digits_and_delimiter' => :'pattern_with_digits_and_delimiter' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'integer' => :'Integer', - :'int32' => :'Integer', - :'int64' => :'Integer', - :'number' => :'Float', - :'float' => :'Float', - :'double' => :'Float', - :'string' => :'String', - :'byte' => :'String', - :'binary' => :'File', - :'date' => :'Date', - :'date_time' => :'DateTime', - :'uuid' => :'String', - :'password' => :'String', - :'pattern_with_digits' => :'String', - :'pattern_with_digits_and_delimiter' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FormatTest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FormatTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'integer') - self.integer = attributes[:'integer'] - end - - if attributes.key?(:'int32') - self.int32 = attributes[:'int32'] - end - - if attributes.key?(:'int64') - self.int64 = attributes[:'int64'] - end - - if attributes.key?(:'number') - self.number = attributes[:'number'] - end - - if attributes.key?(:'float') - self.float = attributes[:'float'] - end - - if attributes.key?(:'double') - self.double = attributes[:'double'] - end - - if attributes.key?(:'string') - self.string = attributes[:'string'] - end - - if attributes.key?(:'byte') - self.byte = attributes[:'byte'] - end - - if attributes.key?(:'binary') - self.binary = attributes[:'binary'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'date_time') - self.date_time = attributes[:'date_time'] - end - - if attributes.key?(:'uuid') - self.uuid = attributes[:'uuid'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'pattern_with_digits') - self.pattern_with_digits = attributes[:'pattern_with_digits'] - end - - if attributes.key?(:'pattern_with_digits_and_delimiter') - self.pattern_with_digits_and_delimiter = attributes[:'pattern_with_digits_and_delimiter'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@integer.nil? && @integer > 100 - invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') - end - - if !@integer.nil? && @integer < 10 - invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') - end - - if !@int32.nil? && @int32 > 200 - invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') - end - - if !@int32.nil? && @int32 < 20 - invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') - end - - if @number.nil? - invalid_properties.push('invalid value for "number", number cannot be nil.') - end - - if @number > 543.2 - invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') - end - - if @number < 32.1 - invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') - end - - if !@float.nil? && @float > 987.6 - invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') - end - - if !@float.nil? && @float < 54.3 - invalid_properties.push('invalid value for "float", must be greater than or equal to 54.3.') - end - - if !@double.nil? && @double > 123.4 - invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') - end - - if !@double.nil? && @double < 67.8 - invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') - end - - pattern = Regexp.new(/[a-z]/i) - if !@string.nil? && @string !~ pattern - invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") - end - - if @byte.nil? - invalid_properties.push('invalid value for "byte", byte cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @password.nil? - invalid_properties.push('invalid value for "password", password cannot be nil.') - end - - if @password.to_s.length > 64 - invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') - end - - if @password.to_s.length < 10 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') - end - - pattern = Regexp.new(/^\d{10}$/) - if !@pattern_with_digits.nil? && @pattern_with_digits !~ pattern - invalid_properties.push("invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}.") - end - - pattern = Regexp.new(/^image_\d{1,3}$/i) - if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ pattern - invalid_properties.push("invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}.") - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@integer.nil? && @integer > 100 - return false if !@integer.nil? && @integer < 10 - return false if !@int32.nil? && @int32 > 200 - return false if !@int32.nil? && @int32 < 20 - return false if @number.nil? - return false if @number > 543.2 - return false if @number < 32.1 - return false if !@float.nil? && @float > 987.6 - return false if !@float.nil? && @float < 54.3 - return false if !@double.nil? && @double > 123.4 - return false if !@double.nil? && @double < 67.8 - return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) - return false if @byte.nil? - return false if @date.nil? - return false if @password.nil? - return false if @password.to_s.length > 64 - return false if @password.to_s.length < 10 - return false if !@pattern_with_digits.nil? && @pattern_with_digits !~ Regexp.new(/^\d{10}$/) - return false if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ Regexp.new(/^image_\d{1,3}$/i) - true - end - - # Custom attribute writer method with validation - # @param [Object] integer Value to be assigned - def integer=(integer) - if !integer.nil? && integer > 100 - fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' - end - - if !integer.nil? && integer < 10 - fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' - end - - @integer = integer - end - - # Custom attribute writer method with validation - # @param [Object] int32 Value to be assigned - def int32=(int32) - if !int32.nil? && int32 > 200 - fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' - end - - if !int32.nil? && int32 < 20 - fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' - end - - @int32 = int32 - end - - # Custom attribute writer method with validation - # @param [Object] number Value to be assigned - def number=(number) - if number.nil? - fail ArgumentError, 'number cannot be nil' - end - - if number > 543.2 - fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' - end - - if number < 32.1 - fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' - end - - @number = number - end - - # Custom attribute writer method with validation - # @param [Object] float Value to be assigned - def float=(float) - if !float.nil? && float > 987.6 - fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' - end - - if !float.nil? && float < 54.3 - fail ArgumentError, 'invalid value for "float", must be greater than or equal to 54.3.' - end - - @float = float - end - - # Custom attribute writer method with validation - # @param [Object] double Value to be assigned - def double=(double) - if !double.nil? && double > 123.4 - fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' - end - - if !double.nil? && double < 67.8 - fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' - end - - @double = double - end - - # Custom attribute writer method with validation - # @param [Object] string Value to be assigned - def string=(string) - pattern = Regexp.new(/[a-z]/i) - if !string.nil? && string !~ pattern - fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." - end - - @string = string - end - - # Custom attribute writer method with validation - # @param [Object] password Value to be assigned - def password=(password) - if password.nil? - fail ArgumentError, 'password cannot be nil' - end - - if password.to_s.length > 64 - fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' - end - - if password.to_s.length < 10 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' - end - - @password = password - end - - # Custom attribute writer method with validation - # @param [Object] pattern_with_digits Value to be assigned - def pattern_with_digits=(pattern_with_digits) - pattern = Regexp.new(/^\d{10}$/) - if !pattern_with_digits.nil? && pattern_with_digits !~ pattern - fail ArgumentError, "invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}." - end - - @pattern_with_digits = pattern_with_digits - end - - # Custom attribute writer method with validation - # @param [Object] pattern_with_digits_and_delimiter Value to be assigned - def pattern_with_digits_and_delimiter=(pattern_with_digits_and_delimiter) - pattern = Regexp.new(/^image_\d{1,3}$/i) - if !pattern_with_digits_and_delimiter.nil? && pattern_with_digits_and_delimiter !~ pattern - fail ArgumentError, "invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}." - end - - @pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - integer == o.integer && - int32 == o.int32 && - int64 == o.int64 && - number == o.number && - float == o.float && - double == o.double && - string == o.string && - byte == o.byte && - binary == o.binary && - date == o.date && - date_time == o.date_time && - uuid == o.uuid && - password == o.password && - pattern_with_digits == o.pattern_with_digits && - pattern_with_digits_and_delimiter == o.pattern_with_digits_and_delimiter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb deleted file mode 100644 index cae8b3bbe70c..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class HasOnlyReadOnly - attr_accessor :bar - - attr_accessor :foo - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bar' => :'bar', - :'foo' => :'foo' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'bar' => :'String', - :'foo' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::HasOnlyReadOnly` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HasOnlyReadOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bar') - self.bar = attributes[:'bar'] - end - - if attributes.key?(:'foo') - self.foo = attributes[:'foo'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bar == o.bar && - foo == o.foo - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bar, foo].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb deleted file mode 100644 index 94873ca4d689..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class List - attr_accessor :_123_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_123_list' => :'123-list' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_123_list' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::List` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::List`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_123_list') - self._123_list = attributes[:'_123_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _123_list == o._123_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_123_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb deleted file mode 100644 index 65f0020e664c..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class MapTest - attr_accessor :map_map_of_string - - attr_accessor :map_of_enum_string - - attr_accessor :direct_map - - attr_accessor :indirect_map - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'map_map_of_string' => :'map_map_of_string', - :'map_of_enum_string' => :'map_of_enum_string', - :'direct_map' => :'direct_map', - :'indirect_map' => :'indirect_map' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'map_map_of_string' => :'Hash>', - :'map_of_enum_string' => :'Hash', - :'direct_map' => :'Hash', - :'indirect_map' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MapTest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MapTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'map_map_of_string') - if (value = attributes[:'map_map_of_string']).is_a?(Hash) - self.map_map_of_string = value - end - end - - if attributes.key?(:'map_of_enum_string') - if (value = attributes[:'map_of_enum_string']).is_a?(Hash) - self.map_of_enum_string = value - end - end - - if attributes.key?(:'direct_map') - if (value = attributes[:'direct_map']).is_a?(Hash) - self.direct_map = value - end - end - - if attributes.key?(:'indirect_map') - if (value = attributes[:'indirect_map']).is_a?(Hash) - self.indirect_map = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - map_map_of_string == o.map_map_of_string && - map_of_enum_string == o.map_of_enum_string && - direct_map == o.direct_map && - indirect_map == o.indirect_map - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [map_map_of_string, map_of_enum_string, direct_map, indirect_map].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb deleted file mode 100644 index 3c5cd7349f5f..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class MixedPropertiesAndAdditionalPropertiesClass - attr_accessor :uuid - - attr_accessor :date_time - - attr_accessor :map - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'uuid' => :'uuid', - :'date_time' => :'dateTime', - :'map' => :'map' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'uuid' => :'String', - :'date_time' => :'DateTime', - :'map' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MixedPropertiesAndAdditionalPropertiesClass` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MixedPropertiesAndAdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'uuid') - self.uuid = attributes[:'uuid'] - end - - if attributes.key?(:'date_time') - self.date_time = attributes[:'date_time'] - end - - if attributes.key?(:'map') - if (value = attributes[:'map']).is_a?(Hash) - self.map = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - uuid == o.uuid && - date_time == o.date_time && - map == o.map - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [uuid, date_time, map].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb deleted file mode 100644 index 950b8408a093..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Model for testing model name starting with number - class Model200Response - attr_accessor :name - - attr_accessor :_class - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'_class' => :'class' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Integer', - :'_class' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Model200Response` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Model200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'_class') - self._class = attributes[:'_class'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - _class == o._class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, _class].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb deleted file mode 100644 index a3b89b37c4b8..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ /dev/null @@ -1,207 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Model for testing reserved words - class ModelReturn - attr_accessor :_return - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_return' => :'return' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_return' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ModelReturn` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ModelReturn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_return') - self._return = attributes[:'_return'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _return == o._return - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_return].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb deleted file mode 100644 index 6aaf40c05d5c..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Model for testing model name same as property name - class Name - attr_accessor :name - - attr_accessor :snake_case - - attr_accessor :property - - attr_accessor :_123_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'snake_case' => :'snake_case', - :'property' => :'property', - :'_123_number' => :'123Number' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Integer', - :'snake_case' => :'Integer', - :'property' => :'String', - :'_123_number' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Name` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Name`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'snake_case') - self.snake_case = attributes[:'snake_case'] - end - - if attributes.key?(:'property') - self.property = attributes[:'property'] - end - - if attributes.key?(:'_123_number') - self._123_number = attributes[:'_123_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - snake_case == o.snake_case && - property == o.property && - _123_number == o._123_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, snake_case, property, _123_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb deleted file mode 100644 index 2e62c4775e1b..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class NumberOnly - attr_accessor :just_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'just_number' => :'JustNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'just_number' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::NumberOnly` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'just_number') - self.just_number = attributes[:'just_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - just_number == o.just_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [just_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb deleted file mode 100644 index 5fc1828efeef..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Order - attr_accessor :id - - attr_accessor :pet_id - - attr_accessor :quantity - - attr_accessor :ship_date - - # Order Status - attr_accessor :status - - attr_accessor :complete - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'pet_id' => :'petId', - :'quantity' => :'quantity', - :'ship_date' => :'shipDate', - :'status' => :'status', - :'complete' => :'complete' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'pet_id' => :'Integer', - :'quantity' => :'Integer', - :'ship_date' => :'DateTime', - :'status' => :'String', - :'complete' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Order` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'pet_id') - self.pet_id = attributes[:'pet_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'ship_date') - self.ship_date = attributes[:'ship_date'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'complete') - self.complete = attributes[:'complete'] - else - self.complete = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - pet_id == o.pet_id && - quantity == o.quantity && - ship_date == o.ship_date && - status == o.status && - complete == o.complete - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, pet_id, quantity, ship_date, status, complete].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb deleted file mode 100644 index f8b23893297e..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class OuterComposite - attr_accessor :my_number - - attr_accessor :my_string - - attr_accessor :my_boolean - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'my_number' => :'my_number', - :'my_string' => :'my_string', - :'my_boolean' => :'my_boolean' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'my_number' => :'Float', - :'my_string' => :'String', - :'my_boolean' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::OuterComposite` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::OuterComposite`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'my_number') - self.my_number = attributes[:'my_number'] - end - - if attributes.key?(:'my_string') - self.my_string = attributes[:'my_string'] - end - - if attributes.key?(:'my_boolean') - self.my_boolean = attributes[:'my_boolean'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - my_number == o.my_number && - my_string == o.my_string && - my_boolean == o.my_boolean - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [my_number, my_string, my_boolean].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb deleted file mode 100644 index d7c1b931b973..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ /dev/null @@ -1,37 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class OuterEnum - 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 self.build_from_hash(value) - new.build_from_hash(value) - end - - # 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) - constantValues = OuterEnum.constants.select { |c| OuterEnum::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #OuterEnum" if constantValues.empty? - value - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb deleted file mode 100644 index 6c67989e4b2e..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ /dev/null @@ -1,300 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Pet - attr_accessor :id - - attr_accessor :category - - attr_accessor :name - - attr_accessor :photo_urls - - attr_accessor :tags - - # pet status in the store - attr_accessor :status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'category' => :'category', - :'name' => :'name', - :'photo_urls' => :'photoUrls', - :'tags' => :'tags', - :'status' => :'status' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'category' => :'Category', - :'name' => :'String', - :'photo_urls' => :'Array', - :'tags' => :'Array', - :'status' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Pet` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'category') - self.category = attributes[:'category'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'photo_urls') - if (value = attributes[:'photo_urls']).is_a?(Array) - self.photo_urls = value - end - end - - if attributes.key?(:'tags') - if (value = attributes[:'tags']).is_a?(Array) - self.tags = value - end - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @photo_urls.nil? - invalid_properties.push('invalid value for "photo_urls", photo_urls cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @photo_urls.nil? - status_validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - category == o.category && - name == o.name && - photo_urls == o.photo_urls && - tags == o.tags && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, category, name, photo_urls, tags, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb deleted file mode 100644 index b8edc7ba8ea5..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ReadOnlyFirst - attr_accessor :bar - - attr_accessor :baz - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bar' => :'bar', - :'baz' => :'baz' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'bar' => :'String', - :'baz' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ReadOnlyFirst` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ReadOnlyFirst`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bar') - self.bar = attributes[:'bar'] - end - - if attributes.key?(:'baz') - self.baz = attributes[:'baz'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bar == o.bar && - baz == o.baz - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bar, baz].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb deleted file mode 100644 index 5c1be0fd3bea..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class SpecialModelName - attr_accessor :special_property_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'special_property_name' => :'$special[property.name]' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'special_property_name' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialModelName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialModelName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'special_property_name') - self.special_property_name = attributes[:'special_property_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - special_property_name == o.special_property_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [special_property_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb deleted file mode 100644 index 86d8c0aa8c57..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Tag - attr_accessor :id - - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Tag` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb deleted file mode 100644 index 096f5452b0d8..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class User - attr_accessor :id - - attr_accessor :username - - attr_accessor :first_name - - attr_accessor :last_name - - attr_accessor :email - - attr_accessor :password - - attr_accessor :phone - - # User Status - attr_accessor :user_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'username' => :'username', - :'first_name' => :'firstName', - :'last_name' => :'lastName', - :'email' => :'email', - :'password' => :'password', - :'phone' => :'phone', - :'user_status' => :'userStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'username' => :'String', - :'first_name' => :'String', - :'last_name' => :'String', - :'email' => :'String', - :'password' => :'String', - :'phone' => :'String', - :'user_status' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::User` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'user_status') - self.user_status = attributes[:'user_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - username == o.username && - first_name == o.first_name && - last_name == o.last_name && - email == o.email && - password == o.password && - phone == o.phone && - user_status == o.user_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, username, first_name, last_name, email, password, phone, user_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb deleted file mode 100644 index fba2068c04db..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb +++ /dev/null @@ -1,15 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -module Petstore - VERSION = '1.0.0' -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec deleted file mode 100644 index 9ec5502dc6ab..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec +++ /dev/null @@ -1,39 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -$:.push File.expand_path("../lib", __FILE__) -require "petstore/version" - -Gem::Specification.new do |s| - s.name = "petstore" - s.version = Petstore::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["OpenAPI-Generator"] - s.email = [""] - s.homepage = "https://openapi-generator.tech" - s.summary = "OpenAPI 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" - s.required_ruby_version = ">= 1.9" - - s.add_runtime_dependency 'faraday', '>= 0.14.0' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb deleted file mode 100644 index bf187f0971fe..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::AnotherFakeApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AnotherFakeApi' do - before do - # run before each test - @api_instance = Petstore::AnotherFakeApi.new - end - - after do - # run after each test - end - - describe 'test an instance of AnotherFakeApi' do - it 'should create an instance of AnotherFakeApi' do - expect(@api_instance).to be_instance_of(Petstore::AnotherFakeApi) - end - end - - # unit tests for call_123_test_special_tags - # To test special tags - # To test special tags and operation ID starting with number - # @param client client model - # @param [Hash] opts the optional parameters - # @return [Client] - describe 'call_123_test_special_tags test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb deleted file mode 100644 index 7374568eaf0d..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::FakeApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'FakeApi' do - before do - # run before each test - @api_instance = Petstore::FakeApi.new - end - - after do - # run after each test - end - - describe 'test an instance of FakeApi' do - it 'should create an instance of FakeApi' do - expect(@api_instance).to be_instance_of(Petstore::FakeApi) - end - end - - # unit tests for fake_health_get - # Health check endpoint - # @param [Hash] opts the optional parameters - # @return [HealthCheckResult] - describe 'fake_health_get test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_http_signature_test - # test http signature authentication - # @param pet Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [nil] - describe 'fake_http_signature_test test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_outer_boolean_serialize - # Test serialization of outer boolean types - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :body Input boolean as post body - # @return [Boolean] - describe 'fake_outer_boolean_serialize test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_outer_composite_serialize - # Test serialization of object with outer number type - # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body - # @return [OuterComposite] - describe 'fake_outer_composite_serialize test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_outer_number_serialize - # Test serialization of outer number types - # @param [Hash] opts the optional parameters - # @option opts [Float] :body Input number as post body - # @return [Float] - describe 'fake_outer_number_serialize test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_outer_string_serialize - # Test serialization of outer string types - # @param [Hash] opts the optional parameters - # @option opts [String] :body Input string as post body - # @return [String] - describe 'fake_outer_string_serialize test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_body_with_file_schema - # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_body_with_file_schema test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_body_with_query_params - # @param query - # @param user - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_body_with_query_params test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_client_model - # To test \"client\" model - # To test \"client\" model - # @param client client model - # @param [Hash] opts the optional parameters - # @return [Client] - describe 'test_client_model test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_endpoint_parameters - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # @param number None - # @param double None - # @param pattern_without_delimiter None - # @param byte None - # @param [Hash] opts the optional parameters - # @option opts [Integer] :integer None - # @option opts [Integer] :int32 None - # @option opts [Integer] :int64 None - # @option opts [Float] :float None - # @option opts [String] :string None - # @option opts [File] :binary None - # @option opts [Date] :date None - # @option opts [DateTime] :date_time None - # @option opts [String] :password None - # @option opts [String] :callback None - # @return [nil] - describe 'test_endpoint_parameters test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_enum_parameters - # To test enum parameters - # 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) - # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) - # @option opts [String] :enum_query_string Query parameter enum test (string) - # @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) - # @return [nil] - describe 'test_enum_parameters test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_group_parameters - # Fake endpoint to test group parameters (optional) - # Fake endpoint to test group parameters (optional) - # @param required_string_group Required String in group parameters - # @param required_boolean_group Required Boolean in group parameters - # @param required_int64_group Required Integer in group parameters - # @param [Hash] opts the optional parameters - # @option opts [Integer] :string_group String in group parameters - # @option opts [Boolean] :boolean_group Boolean in group parameters - # @option opts [Integer] :int64_group Integer in group parameters - # @return [nil] - describe 'test_group_parameters test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_inline_additional_properties - # test inline additionalProperties - # @param request_body request body - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_inline_additional_properties test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_json_form_data - # test json serialization of form data - # @param param field1 - # @param param2 field2 - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_json_form_data test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_query_parameter_collection_format - # To test the collection format in query parameters - # @param pipe - # @param ioutil - # @param http - # @param url - # @param context - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_query_parameter_collection_format test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb deleted file mode 100644 index 1db2b3c9ef52..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::FakeClassnameTags123Api -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'FakeClassnameTags123Api' do - before do - # run before each test - @api_instance = Petstore::FakeClassnameTags123Api.new - end - - after do - # run after each test - end - - describe 'test an instance of FakeClassnameTags123Api' do - it 'should create an instance of FakeClassnameTags123Api' do - expect(@api_instance).to be_instance_of(Petstore::FakeClassnameTags123Api) - end - end - - # unit tests for test_classname - # To test class name in snake case - # To test class name in snake case - # @param client client model - # @param [Hash] opts the optional parameters - # @return [Client] - describe 'test_classname test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb deleted file mode 100644 index 26ca32b2f754..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb +++ /dev/null @@ -1,144 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::PetApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'PetApi' do - before do - # run before each test - @api_instance = Petstore::PetApi.new - end - - after do - # run after each test - end - - describe 'test an instance of PetApi' do - it 'should create an instance of PetApi' do - expect(@api_instance).to be_instance_of(Petstore::PetApi) - end - end - - # unit tests for add_pet - # Add a new pet to the store - # @param pet Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'add_pet test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for delete_pet - # Deletes a pet - # @param pet_id Pet id to delete - # @param [Hash] opts the optional parameters - # @option opts [String] :api_key - # @return [nil] - describe 'delete_pet test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for find_pets_by_status - # Finds Pets by status - # Multiple status values can be provided with comma separated strings - # @param status Status values that need to be considered for filter - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'find_pets_by_status test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for find_pets_by_tags - # Finds Pets by tags - # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - # @param tags Tags to filter by - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'find_pets_by_tags test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_pet_by_id - # Find pet by ID - # Returns a single pet - # @param pet_id ID of pet to return - # @param [Hash] opts the optional parameters - # @return [Pet] - describe 'get_pet_by_id test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for update_pet - # Update an existing pet - # @param pet Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_pet test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for update_pet_with_form - # Updates a pet in the store with form data - # @param pet_id ID of pet that needs to be updated - # @param [Hash] opts the optional parameters - # @option opts [String] :name Updated name of the pet - # @option opts [String] :status Updated status of the pet - # @return [nil] - describe 'update_pet_with_form test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for upload_file - # uploads an image - # @param pet_id ID of pet to update - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @option opts [File] :file file to upload - # @return [ApiResponse] - describe 'upload_file test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for upload_file_with_required_file - # uploads an image (required) - # @param pet_id ID of pet to update - # @param required_file file to upload - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @return [ApiResponse] - describe 'upload_file_with_required_file test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb deleted file mode 100644 index 1fd9faf40aaf..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb +++ /dev/null @@ -1,81 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::StoreApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'StoreApi' do - before do - # run before each test - @api_instance = Petstore::StoreApi.new - end - - after do - # run after each test - end - - describe 'test an instance of StoreApi' do - it 'should create an instance of StoreApi' do - expect(@api_instance).to be_instance_of(Petstore::StoreApi) - end - end - - # unit tests for delete_order - # Delete purchase order by ID - # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - # @param order_id ID of the order that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_order test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_inventory - # Returns pet inventories by status - # Returns a map of status codes to quantities - # @param [Hash] opts the optional parameters - # @return [Hash] - describe 'get_inventory test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_order_by_id - # Find purchase order by ID - # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - # @param order_id ID of pet that needs to be fetched - # @param [Hash] opts the optional parameters - # @return [Order] - describe 'get_order_by_id test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for place_order - # Place an order for a pet - # @param order order placed for purchasing the pet - # @param [Hash] opts the optional parameters - # @return [Order] - describe 'place_order test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb deleted file mode 100644 index 39178c5a5ac7..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb +++ /dev/null @@ -1,127 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::UserApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'UserApi' do - before do - # run before each test - @api_instance = Petstore::UserApi.new - end - - after do - # run after each test - end - - describe 'test an instance of UserApi' do - it 'should create an instance of UserApi' do - expect(@api_instance).to be_instance_of(Petstore::UserApi) - end - end - - # unit tests for create_user - # Create user - # This can only be done by the logged in user. - # @param user Created user object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'create_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for create_users_with_array_input - # Creates list of users with given input array - # @param user List of user object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'create_users_with_array_input test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for create_users_with_list_input - # Creates list of users with given input array - # @param user List of user object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'create_users_with_list_input test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for delete_user - # Delete user - # This can only be done by the logged in user. - # @param username The name that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_user_by_name - # Get user by user name - # @param username The name that needs to be fetched. Use user1 for testing. - # @param [Hash] opts the optional parameters - # @return [User] - describe 'get_user_by_name test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for login_user - # Logs user into the system - # @param username The user name for login - # @param password The password for login in clear text - # @param [Hash] opts the optional parameters - # @return [String] - describe 'login_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for logout_user - # Logs out current logged in user session - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'logout_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for update_user - # Updated user - # This can only be done by the logged in user. - # @param username name that need to be deleted - # @param user Updated user object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb deleted file mode 100644 index 71b2ae211b32..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ /dev/null @@ -1,188 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' - -describe Petstore::ApiClient do - context 'initialization' do - context 'URL stuff' do - context 'host' do - it 'removes http from host' do - Petstore.configure { |c| c.host = 'http://example.com' } - expect(Petstore::Configuration.default.host).to eq('example.com') - end - - it 'removes https from host' do - Petstore.configure { |c| c.host = 'https://wookiee.com' } - expect(Petstore::ApiClient.default.config.host).to eq('wookiee.com') - end - - it 'removes trailing path from host' do - Petstore.configure { |c| c.host = 'hobo.com/v4' } - expect(Petstore::Configuration.default.host).to eq('hobo.com') - end - end - - context 'base_path' do - it "prepends a slash to base_path" do - Petstore.configure { |c| c.base_path = 'v4/dog' } - expect(Petstore::Configuration.default.base_path).to eq('/v4/dog') - end - - it "doesn't prepend a slash if one is already there" do - Petstore.configure { |c| c.base_path = '/v4/dog' } - expect(Petstore::Configuration.default.base_path).to eq('/v4/dog') - end - - it "ends up as a blank string if nil" do - Petstore.configure { |c| c.base_path = nil } - expect(Petstore::Configuration.default.base_path).to eq('') - end - end - end - end - - describe '#deserialize' do - it "handles Array" do - api_client = Petstore::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[12, 34]') - data = api_client.deserialize(response, 'Array') - expect(data).to be_instance_of(Array) - expect(data).to eq([12, 34]) - end - - it 'handles Array>' do - api_client = Petstore::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[[12, 34], [56]]') - data = api_client.deserialize(response, 'Array>') - expect(data).to be_instance_of(Array) - expect(data).to eq([[12, 34], [56]]) - end - - it 'handles Hash' do - api_client = Petstore::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '{"message": "Hello"}') - data = api_client.deserialize(response, 'Hash') - expect(data).to be_instance_of(Hash) - expect(data).to eq(:message => 'Hello') - end - end - - describe "#object_to_hash" do - it 'ignores nils and includes empty arrays' do - # uncomment below to test object_to_hash for model - # api_client = Petstore::ApiClient.new - # _model = Petstore::ModelName.new - # update the model attribute below - # _model.id = 1 - # update the expected value (hash) below - # expected = {id: 1, name: '', tags: []} - # expect(api_client.object_to_hash(_model)).to eq(expected) - end - end - - describe '#build_collection_param' do - let(:param) { ['aa', 'bb', 'cc'] } - let(:api_client) { Petstore::ApiClient.new } - - it 'works for csv' do - expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') - end - - it 'works for ssv' do - expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') - end - - it 'works for tsv' do - expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") - end - - it 'works for pipes' do - expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') - end - - it 'works for multi' do - expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) - end - - it 'fails for invalid collection format' do - expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') - end - end - - describe '#json_mime?' do - let(:api_client) { Petstore::ApiClient.new } - - it 'works' do - expect(api_client.json_mime?(nil)).to eq false - expect(api_client.json_mime?('')).to eq false - - expect(api_client.json_mime?('application/json')).to eq true - expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true - expect(api_client.json_mime?('APPLICATION/JSON')).to eq true - - expect(api_client.json_mime?('application/xml')).to eq false - expect(api_client.json_mime?('text/plain')).to eq false - expect(api_client.json_mime?('application/jsonp')).to eq false - end - end - - describe '#select_header_accept' do - let(:api_client) { Petstore::ApiClient.new } - - it 'works' do - expect(api_client.select_header_accept(nil)).to be_nil - expect(api_client.select_header_accept([])).to be_nil - - expect(api_client.select_header_accept(['application/json'])).to eq('application/json') - expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - - expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') - end - end - - describe '#select_header_content_type' do - let(:api_client) { Petstore::ApiClient.new } - - it 'works' do - expect(api_client.select_header_content_type(nil)).to eq('application/json') - expect(api_client.select_header_content_type([])).to eq('application/json') - - expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') - expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') - end - end - - describe '#sanitize_filename' do - let(:api_client) { Petstore::ApiClient.new } - - it 'works' do - expect(api_client.sanitize_filename('sun')).to eq('sun') - expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb deleted file mode 100644 index 0bea24033c64..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' - -describe Petstore::Configuration do - let(:config) { Petstore::Configuration.default } - - before(:each) do - # uncomment below to setup host and base_path - # require 'URI' - # uri = URI.parse("http://petstore.swagger.io:80/v2") - # Petstore.configure do |c| - # c.host = uri.host - # c.base_path = uri.path - # end - end - - describe '#base_url' do - it 'should have the default value' do - # uncomment below to test default value of the base path - # expect(config.base_url).to eq("http://petstore.swagger.io:80/v2") - end - - it 'should remove trailing slashes' do - [nil, '', '/', '//'].each do |base_path| - config.base_path = base_path - # uncomment below to test trailing slashes - # expect(config.base_url).to eq("http://petstore.swagger.io:80/v2") - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb deleted file mode 100644 index 93a5b0d5fb46..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesClass' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesClass.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesClass' do - it 'should create an instance of AdditionalPropertiesClass' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass) - end - end - describe 'test attribute "map_property"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_of_map_property"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb deleted file mode 100644 index 8b3e9adc5378..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Animal -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Animal' do - before do - # run before each test - @instance = Petstore::Animal.new - end - - after do - # run after each test - end - - describe 'test an instance of Animal' do - it 'should create an instance of Animal' do - expect(@instance).to be_instance_of(Petstore::Animal) - end - end - describe 'test attribute "class_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "color"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb deleted file mode 100644 index 628f1c4d7c17..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ApiResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ApiResponse' do - before do - # run before each test - @instance = Petstore::ApiResponse.new - end - - after do - # run after each test - end - - describe 'test an instance of ApiResponse' do - it 'should create an instance of ApiResponse' do - expect(@instance).to be_instance_of(Petstore::ApiResponse) - end - end - describe 'test attribute "code"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb deleted file mode 100644 index ea41c9a4b380..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ArrayOfArrayOfNumberOnly -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ArrayOfArrayOfNumberOnly' do - before do - # run before each test - @instance = Petstore::ArrayOfArrayOfNumberOnly.new - end - - after do - # run after each test - end - - describe 'test an instance of ArrayOfArrayOfNumberOnly' do - it 'should create an instance of ArrayOfArrayOfNumberOnly' do - expect(@instance).to be_instance_of(Petstore::ArrayOfArrayOfNumberOnly) - end - end - describe 'test attribute "array_array_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb deleted file mode 100644 index ba90932a7976..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ArrayOfNumberOnly -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ArrayOfNumberOnly' do - before do - # run before each test - @instance = Petstore::ArrayOfNumberOnly.new - end - - after do - # run after each test - end - - describe 'test an instance of ArrayOfNumberOnly' do - it 'should create an instance of ArrayOfNumberOnly' do - expect(@instance).to be_instance_of(Petstore::ArrayOfNumberOnly) - end - end - describe 'test attribute "array_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb deleted file mode 100644 index 6ff7397ad43c..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ArrayTest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ArrayTest' do - before do - # run before each test - @instance = Petstore::ArrayTest.new - end - - after do - # run after each test - end - - describe 'test an instance of ArrayTest' do - it 'should create an instance of ArrayTest' do - expect(@instance).to be_instance_of(Petstore::ArrayTest) - end - end - describe 'test attribute "array_of_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "array_array_of_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "array_array_of_model"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb deleted file mode 100644 index 451c59af970f..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Capitalization -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Capitalization' do - before do - # run before each test - @instance = Petstore::Capitalization.new - end - - after do - # run after each test - end - - describe 'test an instance of Capitalization' do - it 'should create an instance of Capitalization' do - expect(@instance).to be_instance_of(Petstore::Capitalization) - end - end - describe 'test attribute "small_camel"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "capital_camel"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "small_snake"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "capital_snake"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "sca_eth_flow_points"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "att_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb deleted file mode 100644 index 926ce8a2a37e..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::CatAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'CatAllOf' do - before do - # run before each test - @instance = Petstore::CatAllOf.new - end - - after do - # run after each test - end - - describe 'test an instance of CatAllOf' do - it 'should create an instance of CatAllOf' do - expect(@instance).to be_instance_of(Petstore::CatAllOf) - end - end - describe 'test attribute "declawed"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb deleted file mode 100644 index 3efb677ce64f..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Cat -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Cat' do - before do - # run before each test - @instance = Petstore::Cat.new - end - - after do - # run after each test - end - - describe 'test an instance of Cat' do - it 'should create an instance of Cat' do - expect(@instance).to be_instance_of(Petstore::Cat) - end - end - describe 'test attribute "declawed"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb deleted file mode 100644 index 82ecd78d9666..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Category -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Category' do - before do - # run before each test - @instance = Petstore::Category.new - end - - after do - # run after each test - end - - describe 'test an instance of Category' do - it 'should create an instance of Category' do - expect(@instance).to be_instance_of(Petstore::Category) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb deleted file mode 100644 index 761e89331276..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ClassModel -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ClassModel' do - before do - # run before each test - @instance = Petstore::ClassModel.new - end - - after do - # run after each test - end - - describe 'test an instance of ClassModel' do - it 'should create an instance of ClassModel' do - expect(@instance).to be_instance_of(Petstore::ClassModel) - end - end - describe 'test attribute "_class"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb deleted file mode 100644 index 4bf1ce0622b1..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Client -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Client' do - before do - # run before each test - @instance = Petstore::Client.new - end - - after do - # run after each test - end - - describe 'test an instance of Client' do - it 'should create an instance of Client' do - expect(@instance).to be_instance_of(Petstore::Client) - end - end - describe 'test attribute "client"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb deleted file mode 100644 index 5596927d4235..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::DogAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'DogAllOf' do - before do - # run before each test - @instance = Petstore::DogAllOf.new - end - - after do - # run after each test - end - - describe 'test an instance of DogAllOf' do - it 'should create an instance of DogAllOf' do - expect(@instance).to be_instance_of(Petstore::DogAllOf) - end - end - describe 'test attribute "breed"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb deleted file mode 100644 index b82df3e9d72d..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Dog -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Dog' do - before do - # run before each test - @instance = Petstore::Dog.new - end - - after do - # run after each test - end - - describe 'test an instance of Dog' do - it 'should create an instance of Dog' do - expect(@instance).to be_instance_of(Petstore::Dog) - end - end - describe 'test attribute "breed"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb deleted file mode 100644 index ac75c92581db..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::EnumArrays -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'EnumArrays' do - before do - # run before each test - @instance = Petstore::EnumArrays.new - end - - after do - # run after each test - end - - describe 'test an instance of EnumArrays' do - it 'should create an instance of EnumArrays' do - expect(@instance).to be_instance_of(Petstore::EnumArrays) - end - end - describe 'test attribute "just_symbol"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', [">=", "$"]) - # validator.allowable_values.each do |value| - # expect { @instance.just_symbol = value }.not_to raise_error - # end - end - end - - describe 'test attribute "array_enum"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["fish", "crab"]) - # validator.allowable_values.each do |value| - # expect { @instance.array_enum = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb deleted file mode 100644 index 29fcd05aa750..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::EnumClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'EnumClass' do - before do - # run before each test - @instance = Petstore::EnumClass.new - end - - after do - # run after each test - end - - describe 'test an instance of EnumClass' do - it 'should create an instance of EnumClass' do - expect(@instance).to be_instance_of(Petstore::EnumClass) - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb deleted file mode 100644 index 7f4c9c97e871..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb +++ /dev/null @@ -1,99 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::EnumTest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'EnumTest' do - before do - # run before each test - @instance = Petstore::EnumTest.new - end - - after do - # run after each test - end - - describe 'test an instance of EnumTest' do - it 'should create an instance of EnumTest' do - expect(@instance).to be_instance_of(Petstore::EnumTest) - end - end - describe 'test attribute "enum_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_string = value }.not_to raise_error - # end - end - end - - describe 'test attribute "enum_string_required"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_string_required = value }.not_to raise_error - # end - end - end - - describe 'test attribute "enum_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [1, -1]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_integer = value }.not_to raise_error - # end - end - end - - describe 'test attribute "enum_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', [1.1, -1.2]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_number = value }.not_to raise_error - # end - end - end - - describe 'test attribute "outer_enum"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "outer_enum_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "outer_enum_default_value"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "outer_enum_integer_default_value"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb deleted file mode 100644 index 8a8d92658c97..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::FileSchemaTestClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'FileSchemaTestClass' do - before do - # run before each test - @instance = Petstore::FileSchemaTestClass.new - end - - after do - # run after each test - end - - describe 'test an instance of FileSchemaTestClass' do - it 'should create an instance of FileSchemaTestClass' do - expect(@instance).to be_instance_of(Petstore::FileSchemaTestClass) - end - end - describe 'test attribute "file"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "files"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb deleted file mode 100644 index b9d1499766ee..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::File -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'File' do - before do - # run before each test - @instance = Petstore::File.new - end - - after do - # run after each test - end - - describe 'test an instance of File' do - it 'should create an instance of File' do - expect(@instance).to be_instance_of(Petstore::File) - end - end - describe 'test attribute "source_uri"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb deleted file mode 100644 index 72fe239f298e..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb +++ /dev/null @@ -1,125 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::FormatTest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'FormatTest' do - before do - # run before each test - @instance = Petstore::FormatTest.new - end - - after do - # run after each test - end - - describe 'test an instance of FormatTest' do - it 'should create an instance of FormatTest' do - expect(@instance).to be_instance_of(Petstore::FormatTest) - end - end - describe 'test attribute "integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "int32"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "int64"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "float"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "double"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "byte"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "binary"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date_time"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "uuid"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "pattern_with_digits"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "pattern_with_digits_and_delimiter"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb deleted file mode 100644 index 9efa03a22fe0..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::HasOnlyReadOnly -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'HasOnlyReadOnly' do - before do - # run before each test - @instance = Petstore::HasOnlyReadOnly.new - end - - after do - # run after each test - end - - describe 'test an instance of HasOnlyReadOnly' do - it 'should create an instance of HasOnlyReadOnly' do - expect(@instance).to be_instance_of(Petstore::HasOnlyReadOnly) - end - end - describe 'test attribute "bar"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "foo"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb deleted file mode 100644 index db397aa108fa..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::List -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'List' do - before do - # run before each test - @instance = Petstore::List.new - end - - after do - # run after each test - end - - describe 'test an instance of List' do - it 'should create an instance of List' do - expect(@instance).to be_instance_of(Petstore::List) - end - end - describe 'test attribute "_123_list"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb deleted file mode 100644 index f7ff6788b095..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb +++ /dev/null @@ -1,63 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::MapTest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'MapTest' do - before do - # run before each test - @instance = Petstore::MapTest.new - end - - after do - # run after each test - end - - describe 'test an instance of MapTest' do - it 'should create an instance of MapTest' do - expect(@instance).to be_instance_of(Petstore::MapTest) - end - end - describe 'test attribute "map_map_of_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_of_enum_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Hash', ["UPPER", "lower"]) - # validator.allowable_values.each do |value| - # expect { @instance.map_of_enum_string = value }.not_to raise_error - # end - end - end - - describe 'test attribute "direct_map"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "indirect_map"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb deleted file mode 100644 index 0e88f4725244..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::MixedPropertiesAndAdditionalPropertiesClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'MixedPropertiesAndAdditionalPropertiesClass' do - before do - # run before each test - @instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new - end - - after do - # run after each test - end - - describe 'test an instance of MixedPropertiesAndAdditionalPropertiesClass' do - it 'should create an instance of MixedPropertiesAndAdditionalPropertiesClass' do - expect(@instance).to be_instance_of(Petstore::MixedPropertiesAndAdditionalPropertiesClass) - end - end - describe 'test attribute "uuid"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date_time"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb deleted file mode 100644 index 133f6b94c145..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Model200Response -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Model200Response' do - before do - # run before each test - @instance = Petstore::Model200Response.new - end - - after do - # run after each test - end - - describe 'test an instance of Model200Response' do - it 'should create an instance of Model200Response' do - expect(@instance).to be_instance_of(Petstore::Model200Response) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "_class"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb deleted file mode 100644 index 57d400eb1169..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ModelReturn -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ModelReturn' do - before do - # run before each test - @instance = Petstore::ModelReturn.new - end - - after do - # run after each test - end - - describe 'test an instance of ModelReturn' do - it 'should create an instance of ModelReturn' do - expect(@instance).to be_instance_of(Petstore::ModelReturn) - end - end - describe 'test attribute "_return"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb deleted file mode 100644 index c882db4f2215..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Name -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Name' do - before do - # run before each test - @instance = Petstore::Name.new - end - - after do - # run after each test - end - - describe 'test an instance of Name' do - it 'should create an instance of Name' do - expect(@instance).to be_instance_of(Petstore::Name) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "snake_case"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "property"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "_123_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb deleted file mode 100644 index 0963591fcc12..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::NumberOnly -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'NumberOnly' do - before do - # run before each test - @instance = Petstore::NumberOnly.new - end - - after do - # run after each test - end - - describe 'test an instance of NumberOnly' do - it 'should create an instance of NumberOnly' do - expect(@instance).to be_instance_of(Petstore::NumberOnly) - end - end - describe 'test attribute "just_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb deleted file mode 100644 index 3f1d973b2751..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Order -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Order' do - before do - # run before each test - @instance = Petstore::Order.new - end - - after do - # run after each test - end - - describe 'test an instance of Order' do - it 'should create an instance of Order' do - expect(@instance).to be_instance_of(Petstore::Order) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "pet_id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "quantity"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "ship_date"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) - # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error - # end - end - end - - describe 'test attribute "complete"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb deleted file mode 100644 index bb36f4889592..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::OuterComposite -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'OuterComposite' do - before do - # run before each test - @instance = Petstore::OuterComposite.new - end - - after do - # run after each test - end - - describe 'test an instance of OuterComposite' do - it 'should create an instance of OuterComposite' do - expect(@instance).to be_instance_of(Petstore::OuterComposite) - end - end - describe 'test attribute "my_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "my_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "my_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb deleted file mode 100644 index ea9762da93bf..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::OuterEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'OuterEnum' do - before do - # run before each test - @instance = Petstore::OuterEnum.new - end - - after do - # run after each test - end - - describe 'test an instance of OuterEnum' do - it 'should create an instance of OuterEnum' do - expect(@instance).to be_instance_of(Petstore::OuterEnum) - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb deleted file mode 100644 index dc0a0898c9ff..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Pet -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Pet' do - before do - # run before each test - @instance = Petstore::Pet.new - end - - after do - # run after each test - end - - describe 'test an instance of Pet' do - it 'should create an instance of Pet' do - expect(@instance).to be_instance_of(Petstore::Pet) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "category"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "photo_urls"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "tags"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["available", "pending", "sold"]) - # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb deleted file mode 100644 index 8d60e4433132..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ReadOnlyFirst -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ReadOnlyFirst' do - before do - # run before each test - @instance = Petstore::ReadOnlyFirst.new - end - - after do - # run after each test - end - - describe 'test an instance of ReadOnlyFirst' do - it 'should create an instance of ReadOnlyFirst' do - expect(@instance).to be_instance_of(Petstore::ReadOnlyFirst) - end - end - describe 'test attribute "bar"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "baz"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb deleted file mode 100644 index b548f7f0951d..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::SpecialModelName -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'SpecialModelName' do - before do - # run before each test - @instance = Petstore::SpecialModelName.new - end - - after do - # run after each test - end - - describe 'test an instance of SpecialModelName' do - it 'should create an instance of SpecialModelName' do - expect(@instance).to be_instance_of(Petstore::SpecialModelName) - end - end - describe 'test attribute "special_property_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb deleted file mode 100644 index 3a7454390401..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Tag -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Tag' do - before do - # run before each test - @instance = Petstore::Tag.new - end - - after do - # run after each test - end - - describe 'test an instance of Tag' do - it 'should create an instance of Tag' do - expect(@instance).to be_instance_of(Petstore::Tag) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb deleted file mode 100644 index 2eb31e993a09..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb +++ /dev/null @@ -1,83 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::User -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'User' do - before do - # run before each test - @instance = Petstore::User.new - end - - after do - # run after each test - end - - describe 'test an instance of User' do - it 'should create an instance of User' do - expect(@instance).to be_instance_of(Petstore::User) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "first_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "last_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "email"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "phone"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "user_status"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb deleted file mode 100644 index 64dcf6b8f471..000000000000 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb +++ /dev/null @@ -1,111 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -# load the gem -require 'petstore' - -# The following was generated by the `rspec --init` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# The `.rspec` file also contains a few flags that are not defaults but that -# users commonly want. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true - end - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # These two settings work together to allow you to limit a spec run - # to individual examples or groups you care about by tagging them with - # `:focus` metadata. When nothing is tagged with `:focus`, all examples - # get run. - config.filter_run :focus - config.run_all_when_everything_filtered = true - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # This setting enables warnings. It's recommended, but in some cases may - # be too noisy due to issues in dependencies. - config.warnings = true - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = 'doc' - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end -end diff --git a/samples/openapi3/client/petstore/ruby/.gitignore b/samples/openapi3/client/petstore/ruby/.gitignore deleted file mode 100644 index 05a17cb8f0a0..000000000000 --- a/samples/openapi3/client/petstore/ruby/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://openapi-generator.tech -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/samples/openapi3/client/petstore/ruby/.openapi-generator-ignore b/samples/openapi3/client/petstore/ruby/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/ruby/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/ruby/.openapi-generator/FILES b/samples/openapi3/client/petstore/ruby/.openapi-generator/FILES deleted file mode 100644 index 61a40c4b9a02..000000000000 --- a/samples/openapi3/client/petstore/ruby/.openapi-generator/FILES +++ /dev/null @@ -1,186 +0,0 @@ -.gitignore -.rspec -.rubocop.yml -.travis.yml -Gemfile -README.md -Rakefile -docs/AdditionalPropertiesClass.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/DefaultApi.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/Foo.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md -docs/InlineResponseDefault.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Name.md -docs/NullableClass.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterEnumDefaultValue.md -docs/OuterEnumInteger.md -docs/OuterEnumIntegerDefaultValue.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/User.md -docs/UserApi.md -git_push.sh -lib/petstore.rb -lib/petstore/api/another_fake_api.rb -lib/petstore/api/default_api.rb -lib/petstore/api/fake_api.rb -lib/petstore/api/fake_classname_tags123_api.rb -lib/petstore/api/pet_api.rb -lib/petstore/api/store_api.rb -lib/petstore/api/user_api.rb -lib/petstore/api_client.rb -lib/petstore/api_error.rb -lib/petstore/configuration.rb -lib/petstore/configuration.rb -lib/petstore/models/additional_properties_class.rb -lib/petstore/models/animal.rb -lib/petstore/models/api_response.rb -lib/petstore/models/array_of_array_of_number_only.rb -lib/petstore/models/array_of_number_only.rb -lib/petstore/models/array_test.rb -lib/petstore/models/capitalization.rb -lib/petstore/models/cat.rb -lib/petstore/models/cat_all_of.rb -lib/petstore/models/category.rb -lib/petstore/models/class_model.rb -lib/petstore/models/client.rb -lib/petstore/models/dog.rb -lib/petstore/models/dog_all_of.rb -lib/petstore/models/enum_arrays.rb -lib/petstore/models/enum_class.rb -lib/petstore/models/enum_test.rb -lib/petstore/models/file.rb -lib/petstore/models/file_schema_test_class.rb -lib/petstore/models/foo.rb -lib/petstore/models/format_test.rb -lib/petstore/models/has_only_read_only.rb -lib/petstore/models/health_check_result.rb -lib/petstore/models/inline_object.rb -lib/petstore/models/inline_object1.rb -lib/petstore/models/inline_object2.rb -lib/petstore/models/inline_object3.rb -lib/petstore/models/inline_object4.rb -lib/petstore/models/inline_object5.rb -lib/petstore/models/inline_response_default.rb -lib/petstore/models/list.rb -lib/petstore/models/map_test.rb -lib/petstore/models/mixed_properties_and_additional_properties_class.rb -lib/petstore/models/model200_response.rb -lib/petstore/models/model_return.rb -lib/petstore/models/name.rb -lib/petstore/models/nullable_class.rb -lib/petstore/models/number_only.rb -lib/petstore/models/order.rb -lib/petstore/models/outer_composite.rb -lib/petstore/models/outer_enum.rb -lib/petstore/models/outer_enum_default_value.rb -lib/petstore/models/outer_enum_integer.rb -lib/petstore/models/outer_enum_integer_default_value.rb -lib/petstore/models/pet.rb -lib/petstore/models/read_only_first.rb -lib/petstore/models/special_model_name.rb -lib/petstore/models/tag.rb -lib/petstore/models/user.rb -lib/petstore/version.rb -petstore.gemspec -spec/api/another_fake_api_spec.rb -spec/api/default_api_spec.rb -spec/api/fake_api_spec.rb -spec/api/fake_classname_tags123_api_spec.rb -spec/api/pet_api_spec.rb -spec/api/store_api_spec.rb -spec/api/user_api_spec.rb -spec/api_client_spec.rb -spec/configuration_spec.rb -spec/models/additional_properties_class_spec.rb -spec/models/animal_spec.rb -spec/models/api_response_spec.rb -spec/models/array_of_array_of_number_only_spec.rb -spec/models/array_of_number_only_spec.rb -spec/models/array_test_spec.rb -spec/models/capitalization_spec.rb -spec/models/cat_all_of_spec.rb -spec/models/cat_spec.rb -spec/models/category_spec.rb -spec/models/class_model_spec.rb -spec/models/client_spec.rb -spec/models/dog_all_of_spec.rb -spec/models/dog_spec.rb -spec/models/enum_arrays_spec.rb -spec/models/enum_class_spec.rb -spec/models/enum_test_spec.rb -spec/models/file_schema_test_class_spec.rb -spec/models/file_spec.rb -spec/models/foo_spec.rb -spec/models/format_test_spec.rb -spec/models/has_only_read_only_spec.rb -spec/models/health_check_result_spec.rb -spec/models/inline_object1_spec.rb -spec/models/inline_object2_spec.rb -spec/models/inline_object3_spec.rb -spec/models/inline_object4_spec.rb -spec/models/inline_object5_spec.rb -spec/models/inline_object_spec.rb -spec/models/inline_response_default_spec.rb -spec/models/list_spec.rb -spec/models/map_test_spec.rb -spec/models/mixed_properties_and_additional_properties_class_spec.rb -spec/models/model200_response_spec.rb -spec/models/model_return_spec.rb -spec/models/name_spec.rb -spec/models/nullable_class_spec.rb -spec/models/number_only_spec.rb -spec/models/order_spec.rb -spec/models/outer_composite_spec.rb -spec/models/outer_enum_default_value_spec.rb -spec/models/outer_enum_integer_default_value_spec.rb -spec/models/outer_enum_integer_spec.rb -spec/models/outer_enum_spec.rb -spec/models/pet_spec.rb -spec/models/read_only_first_spec.rb -spec/models/special_model_name_spec.rb -spec/models/tag_spec.rb -spec/models/user_spec.rb -spec/spec_helper.rb diff --git a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01f..000000000000 --- a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby/.rspec b/samples/openapi3/client/petstore/ruby/.rspec deleted file mode 100644 index 83e16f804474..000000000000 --- a/samples/openapi3/client/petstore/ruby/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/samples/openapi3/client/petstore/ruby/.rubocop.yml b/samples/openapi3/client/petstore/ruby/.rubocop.yml deleted file mode 100644 index df46058490d0..000000000000 --- a/samples/openapi3/client/petstore/ruby/.rubocop.yml +++ /dev/null @@ -1,148 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) -AllCops: - TargetRubyVersion: 2.4 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstArgumentIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: indented_internal_methods - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingEmptyLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/RedundantPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Layout/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/samples/openapi3/client/petstore/ruby/.travis.yml b/samples/openapi3/client/petstore/ruby/.travis.yml deleted file mode 100644 index d2d526df5942..000000000000 --- a/samples/openapi3/client/petstore/ruby/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: ruby -cache: bundler -rvm: - - 2.3 - - 2.4 - - 2.5 -script: - - bundle install --path vendor/bundle - - bundle exec rspec - - gem build petstore.gemspec - - gem install ./petstore-1.0.0.gem diff --git a/samples/openapi3/client/petstore/ruby/Gemfile b/samples/openapi3/client/petstore/ruby/Gemfile deleted file mode 100644 index c2e3127cdcfe..000000000000 --- a/samples/openapi3/client/petstore/ruby/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/samples/openapi3/client/petstore/ruby/README.md b/samples/openapi3/client/petstore/ruby/README.md deleted file mode 100644 index 719039e53116..000000000000 --- a/samples/openapi3/client/petstore/ruby/README.md +++ /dev/null @@ -1,209 +0,0 @@ -# petstore - -Petstore - the Ruby gem for the OpenAPI 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 [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.RubyClientCodegen - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build petstore.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./petstore-1.0.0.gem -``` - -(for development, run `gem install --dev ./petstore-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'petstore', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: - -```ruby -# Load the gem -require 'petstore' - -api_instance = Petstore::AnotherFakeApi.new -client = Petstore::Client.new # Client | client model - -begin - #To test special tags - result = api_instance.call_123_test_special_tags(client) - p result -rescue Petstore::ApiError => e - puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" -end - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | -*Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication -*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*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_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | -*Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*Petstore::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*Petstore::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*Petstore::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*Petstore::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*Petstore::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*Petstore::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*Petstore::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*Petstore::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*Petstore::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation for Models - - - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Petstore::Animal](docs/Animal.md) - - [Petstore::ApiResponse](docs/ApiResponse.md) - - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [Petstore::ArrayTest](docs/ArrayTest.md) - - [Petstore::Capitalization](docs/Capitalization.md) - - [Petstore::Cat](docs/Cat.md) - - [Petstore::CatAllOf](docs/CatAllOf.md) - - [Petstore::Category](docs/Category.md) - - [Petstore::ClassModel](docs/ClassModel.md) - - [Petstore::Client](docs/Client.md) - - [Petstore::Dog](docs/Dog.md) - - [Petstore::DogAllOf](docs/DogAllOf.md) - - [Petstore::EnumArrays](docs/EnumArrays.md) - - [Petstore::EnumClass](docs/EnumClass.md) - - [Petstore::EnumTest](docs/EnumTest.md) - - [Petstore::File](docs/File.md) - - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Petstore::Foo](docs/Foo.md) - - [Petstore::FormatTest](docs/FormatTest.md) - - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) - - [Petstore::InlineObject](docs/InlineObject.md) - - [Petstore::InlineObject1](docs/InlineObject1.md) - - [Petstore::InlineObject2](docs/InlineObject2.md) - - [Petstore::InlineObject3](docs/InlineObject3.md) - - [Petstore::InlineObject4](docs/InlineObject4.md) - - [Petstore::InlineObject5](docs/InlineObject5.md) - - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) - - [Petstore::List](docs/List.md) - - [Petstore::MapTest](docs/MapTest.md) - - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Petstore::Model200Response](docs/Model200Response.md) - - [Petstore::ModelReturn](docs/ModelReturn.md) - - [Petstore::Name](docs/Name.md) - - [Petstore::NullableClass](docs/NullableClass.md) - - [Petstore::NumberOnly](docs/NumberOnly.md) - - [Petstore::Order](docs/Order.md) - - [Petstore::OuterComposite](docs/OuterComposite.md) - - [Petstore::OuterEnum](docs/OuterEnum.md) - - [Petstore::OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [Petstore::OuterEnumInteger](docs/OuterEnumInteger.md) - - [Petstore::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [Petstore::Pet](docs/Pet.md) - - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Petstore::SpecialModelName](docs/SpecialModelName.md) - - [Petstore::Tag](docs/Tag.md) - - [Petstore::User](docs/User.md) - - -## Documentation for Authorization - - -### api_key - - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -### api_key_query - - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -### bearer_test - -- **Type**: Bearer authentication (JWT) - -### http_basic_test - -- **Type**: HTTP basic authentication - -### http_signature_test - - -### petstore_auth - - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - write:pets: modify pets in your account - - read:pets: read your pets - diff --git a/samples/openapi3/client/petstore/ruby/Rakefile b/samples/openapi3/client/petstore/ruby/Rakefile deleted file mode 100644 index c72ca30d454e..000000000000 --- a/samples/openapi3/client/petstore/ruby/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require "bundler/gem_tasks" - -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/samples/openapi3/client/petstore/ruby/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/ruby/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e0d6811081cd..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::AdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_property** | **Hash<String, String>** | | [optional] -**map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::AdditionalPropertiesClass.new(map_property: null, - map_of_map_property: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Animal.md b/samples/openapi3/client/petstore/ruby/docs/Animal.md deleted file mode 100644 index 80e132d13e45..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Animal.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::Animal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **String** | | -**color** | **String** | | [optional] [default to 'red'] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Animal.new(class_name: null, - color: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/ruby/docs/AnotherFakeApi.md deleted file mode 100644 index d7b52283ea50..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/AnotherFakeApi.md +++ /dev/null @@ -1,56 +0,0 @@ -# Petstore::AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - - -## call_123_test_special_tags - -> Client call_123_test_special_tags(client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::AnotherFakeApi.new -client = Petstore::Client.new # Client | client model - -begin - #To test special tags - result = api_instance.call_123_test_special_tags(client) - p result -rescue Petstore::ApiError => e - puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/ruby/docs/ApiResponse.md b/samples/openapi3/client/petstore/ruby/docs/ApiResponse.md deleted file mode 100644 index c0ac7c4b4c17..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/ApiResponse.md +++ /dev/null @@ -1,21 +0,0 @@ -# Petstore::ApiResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ApiResponse.new(code: null, - type: null, - message: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/ruby/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 5bb9ff33be21..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::ArrayOfArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **Array<Array<Float>>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ArrayOfArrayOfNumberOnly.new(array_array_number: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/ruby/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 8adb00978acc..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::ArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **Array<Float>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ArrayOfNumberOnly.new(array_number: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/ArrayTest.md b/samples/openapi3/client/petstore/ruby/docs/ArrayTest.md deleted file mode 100644 index 76e3866ba9c2..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/ArrayTest.md +++ /dev/null @@ -1,21 +0,0 @@ -# Petstore::ArrayTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **Array<String>** | | [optional] -**array_array_of_integer** | **Array<Array<Integer>>** | | [optional] -**array_array_of_model** | **Array<Array<ReadOnlyFirst>>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ArrayTest.new(array_of_string: null, - array_array_of_integer: null, - array_array_of_model: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Capitalization.md b/samples/openapi3/client/petstore/ruby/docs/Capitalization.md deleted file mode 100644 index d1ac69ceb185..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Capitalization.md +++ /dev/null @@ -1,27 +0,0 @@ -# Petstore::Capitalization - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **String** | | [optional] -**capital_camel** | **String** | | [optional] -**small_snake** | **String** | | [optional] -**capital_snake** | **String** | | [optional] -**sca_eth_flow_points** | **String** | | [optional] -**att_name** | **String** | Name of the pet | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Capitalization.new(small_camel: null, - capital_camel: null, - small_snake: null, - capital_snake: null, - sca_eth_flow_points: null, - att_name: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Cat.md b/samples/openapi3/client/petstore/ruby/docs/Cat.md deleted file mode 100644 index 054fbfadafd3..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Cat.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::Cat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Boolean** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Cat.new(declawed: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/CatAllOf.md b/samples/openapi3/client/petstore/ruby/docs/CatAllOf.md deleted file mode 100644 index a83a6f756620..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/CatAllOf.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::CatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Boolean** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::CatAllOf.new(declawed: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Category.md b/samples/openapi3/client/petstore/ruby/docs/Category.md deleted file mode 100644 index 942f88759ea6..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Category.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::Category - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**name** | **String** | | [default to 'default-name'] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Category.new(id: null, - name: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/ClassModel.md b/samples/openapi3/client/petstore/ruby/docs/ClassModel.md deleted file mode 100644 index faf38fde16d9..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/ClassModel.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::ClassModel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ClassModel.new(_class: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Client.md b/samples/openapi3/client/petstore/ruby/docs/Client.md deleted file mode 100644 index da87ce113cb3..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Client.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::Client - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Client.new(client: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Dog.md b/samples/openapi3/client/petstore/ruby/docs/Dog.md deleted file mode 100644 index 68c2e5d7e0e5..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Dog.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::Dog - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Dog.new(breed: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/DogAllOf.md b/samples/openapi3/client/petstore/ruby/docs/DogAllOf.md deleted file mode 100644 index 6107fd0c10f5..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/DogAllOf.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::DogAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::DogAllOf.new(breed: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/EnumArrays.md b/samples/openapi3/client/petstore/ruby/docs/EnumArrays.md deleted file mode 100644 index 18efa20299d0..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/EnumArrays.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::EnumArrays - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **String** | | [optional] -**array_enum** | **Array<String>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::EnumArrays.new(just_symbol: null, - array_enum: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/EnumClass.md b/samples/openapi3/client/petstore/ruby/docs/EnumClass.md deleted file mode 100644 index 0fca9b27f5ce..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/EnumClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# Petstore::EnumClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::EnumClass.new() -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/EnumTest.md b/samples/openapi3/client/petstore/ruby/docs/EnumTest.md deleted file mode 100644 index e43f07205363..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/EnumTest.md +++ /dev/null @@ -1,31 +0,0 @@ -# Petstore::EnumTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string** | **String** | | [optional] -**enum_string_required** | **String** | | -**enum_integer** | **Integer** | | [optional] -**enum_number** | **Float** | | [optional] -**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::EnumTest.new(enum_string: null, - enum_string_required: null, - enum_integer: null, - enum_number: null, - outer_enum: null, - outer_enum_integer: null, - outer_enum_default_value: null, - outer_enum_integer_default_value: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md deleted file mode 100644 index 4552514bc792..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md +++ /dev/null @@ -1,794 +0,0 @@ -# Petstore::FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**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_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | - - - -## fake_health_get - -> HealthCheckResult fake_health_get - -Health check endpoint - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new - -begin - #Health check endpoint - result = api_instance.fake_health_get - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_health_get: #{e}" -end -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## fake_http_signature_test - -> fake_http_signature_test(pet, opts) - -test http signature authentication - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| -end - -api_instance = Petstore::FakeApi.new -pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store -opts = { - query_1: 'query_1_example', # String | query parameter - header_1: 'header_1_example' # String | header parameter -} - -begin - #test http signature authentication - api_instance.fake_http_signature_test(pet, opts) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_http_signature_test: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query_1** | **String**| query parameter | [optional] - **header_1** | **String**| header parameter | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## fake_outer_boolean_serialize - -> Boolean fake_outer_boolean_serialize(opts) - - - -Test serialization of outer boolean types - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - body: true # Boolean | Input boolean as post body -} - -begin - result = api_instance.fake_outer_boolean_serialize(opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_boolean_serialize: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Boolean**| Input boolean as post body | [optional] - -### Return type - -**Boolean** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - - -## fake_outer_composite_serialize - -> OuterComposite fake_outer_composite_serialize(opts) - - - -Test serialization of object with outer number type - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body -} - -begin - result = api_instance.fake_outer_composite_serialize(opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_composite_serialize: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - - -## fake_outer_number_serialize - -> Float fake_outer_number_serialize(opts) - - - -Test serialization of outer number types - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - body: 3.4 # Float | Input number as post body -} - -begin - result = api_instance.fake_outer_number_serialize(opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_number_serialize: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Float**| Input number as post body | [optional] - -### Return type - -**Float** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - - -## fake_outer_string_serialize - -> String fake_outer_string_serialize(opts) - - - -Test serialization of outer string types - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - body: 'body_example' # String | Input string as post body -} - -begin - result = api_instance.fake_outer_string_serialize(opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_string_serialize: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String**| Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - - -## test_body_with_file_schema - -> test_body_with_file_schema(file_schema_test_class) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | - -begin - api_instance.test_body_with_file_schema(file_schema_test_class) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## test_body_with_query_params - -> test_body_with_query_params(query, user) - - - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -query = 'query_example' # String | -user = Petstore::User.new # User | - -begin - api_instance.test_body_with_query_params(query, user) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_body_with_query_params: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String**| | - **user** | [**User**](User.md)| | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## test_client_model - -> Client test_client_model(client) - -To test \"client\" model - -To test \"client\" model - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -client = Petstore::Client.new # Client | client model - -begin - #To test \"client\" model - result = api_instance.test_client_model(client) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_client_model: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## test_endpoint_parameters - -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure HTTP basic authorization: http_basic_test - config.username = 'YOUR USERNAME' - config.password = 'YOUR PASSWORD' -end - -api_instance = Petstore::FakeApi.new -number = 3.4 # Float | None -double = 3.4 # Float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # String | None -byte = 'byte_example' # String | None -opts = { - integer: 56, # Integer | None - int32: 56, # Integer | None - int64: 56, # Integer | None - float: 3.4, # Float | None - string: 'string_example', # String | None - binary: File.new('/path/to/file'), # File | None - date: Date.parse('2013-10-20'), # Date | None - date_time: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | None - password: 'password_example', # String | None - callback: 'callback_example' # String | None -} - -begin - #Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_endpoint_parameters: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **Float**| None | - **double** | **Float**| None | - **pattern_without_delimiter** | **String**| None | - **byte** | **String**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Integer**| None | [optional] - **float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **File**| None | [optional] - **date** | **Date**| None | [optional] - **date_time** | **DateTime**| None | [optional] - **password** | **String**| None | [optional] - **callback** | **String**| None | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## test_enum_parameters - -> test_enum_parameters(opts) - -To test enum parameters - -To test enum parameters - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -opts = { - enum_header_string_array: ['enum_header_string_array_example'], # Array | Header parameter enum test (string array) - enum_header_string: '-efg', # String | Header parameter enum test (string) - enum_query_string_array: ['enum_query_string_array_example'], # Array | Query parameter enum test (string array) - enum_query_string: '-efg', # String | Query parameter enum test (string) - 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: '$', # Array | Form parameter enum test (string array) - enum_form_string: '-efg' # String | Form parameter enum test (string) -} - -begin - #To test enum parameters - api_instance.test_enum_parameters(opts) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_enum_parameters: #{e}" -end -``` - -### Parameters - - -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_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_integer** | **Integer**| Query parameter enum test (double) | [optional] - **enum_query_double** | **Float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**Array<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## test_group_parameters - -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure Bearer authorization (JWT): bearer_test - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = Petstore::FakeApi.new -required_string_group = 56 # Integer | Required String in group parameters -required_boolean_group = true # Boolean | Required Boolean in group parameters -required_int64_group = 56 # Integer | Required Integer in group parameters -opts = { - string_group: 56, # Integer | String in group parameters - boolean_group: true, # Boolean | Boolean in group parameters - int64_group: 56 # Integer | Integer in group parameters -} - -begin - #Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_group_parameters: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **Integer**| Required String in group parameters | - **required_boolean_group** | **Boolean**| Required Boolean in group parameters | - **required_int64_group** | **Integer**| Required Integer in group parameters | - **string_group** | **Integer**| String in group parameters | [optional] - **boolean_group** | **Boolean**| Boolean in group parameters | [optional] - **int64_group** | **Integer**| Integer in group parameters | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## test_inline_additional_properties - -> test_inline_additional_properties(request_body) - -test inline additionalProperties - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -request_body = {'key' => 'request_body_example'} # Hash | request body - -begin - #test inline additionalProperties - api_instance.test_inline_additional_properties(request_body) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_body** | [**Hash<String, String>**](String.md)| request body | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## 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/x-www-form-urlencoded -- **Accept**: Not defined - - -## test_query_parameter_collection_format - -> test_query_parameter_collection_format(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::FakeApi.new -pipe = ['pipe_example'] # Array | -ioutil = ['ioutil_example'] # Array | -http = ['http_example'] # Array | -url = ['url_example'] # Array | -context = ['context_example'] # Array | - -begin - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) -rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**Array<String>**](String.md)| | - **ioutil** | [**Array<String>**](String.md)| | - **http** | [**Array<String>**](String.md)| | - **url** | [**Array<String>**](String.md)| | - **context** | [**Array<String>**](String.md)| | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - diff --git a/samples/openapi3/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/ruby/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 4ccb9083cbae..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,63 +0,0 @@ -# Petstore::FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -## test_classname - -> Client test_classname(client) - -To test class name in snake case - -To test class name in snake case - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure API key authorization: api_key_query - config.api_key['api_key_query'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api_key_query'] = 'Bearer' -end - -api_instance = Petstore::FakeClassnameTags123Api.new -client = Petstore::Client.new # Client | client model - -begin - #To test class name in snake case - result = api_instance.test_classname(client) - p result -rescue Petstore::ApiError => e - puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/ruby/docs/File.md b/samples/openapi3/client/petstore/ruby/docs/File.md deleted file mode 100644 index ca8a6e9c3136..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/File.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::File - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **String** | Test capitalization | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::File.new(source_uri: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/ruby/docs/FileSchemaTestClass.md deleted file mode 100644 index 03ee5f7e803b..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::FileSchemaTestClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | **File** | | [optional] -**files** | **Array<File>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::FileSchemaTestClass.new(file: null, - files: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/FormatTest.md b/samples/openapi3/client/petstore/ruby/docs/FormatTest.md deleted file mode 100644 index ca468a3d6506..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/FormatTest.md +++ /dev/null @@ -1,45 +0,0 @@ -# Petstore::FormatTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | | [optional] -**int32** | **Integer** | | [optional] -**int64** | **Integer** | | [optional] -**number** | **Float** | | -**float** | **Float** | | [optional] -**double** | **Float** | | [optional] -**string** | **String** | | [optional] -**byte** | **String** | | -**binary** | **File** | | [optional] -**date** | **Date** | | -**date_time** | **DateTime** | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | -**pattern_with_digits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**pattern_with_digits_and_delimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::FormatTest.new(integer: null, - int32: null, - int64: null, - number: null, - float: null, - double: null, - string: null, - byte: null, - binary: null, - date: null, - date_time: null, - uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84, - password: null, - pattern_with_digits: null, - pattern_with_digits_and_delimiter: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/ruby/docs/HasOnlyReadOnly.md deleted file mode 100644 index a15219a9c7b1..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::HasOnlyReadOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::HasOnlyReadOnly.new(bar: null, - foo: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/List.md b/samples/openapi3/client/petstore/ruby/docs/List.md deleted file mode 100644 index 4add9c3fd230..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/List.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::List - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::List.new(_123_list: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/MapTest.md b/samples/openapi3/client/petstore/ruby/docs/MapTest.md deleted file mode 100644 index 9bf1793ec082..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/MapTest.md +++ /dev/null @@ -1,23 +0,0 @@ -# Petstore::MapTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **Hash<String, Hash<String, String>>** | | [optional] -**map_of_enum_string** | **Hash<String, String>** | | [optional] -**direct_map** | **Hash<String, Boolean>** | | [optional] -**indirect_map** | **Hash<String, Boolean>** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::MapTest.new(map_map_of_string: null, - map_of_enum_string: null, - direct_map: null, - indirect_map: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/ruby/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index a0d78f1d0b82..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,21 +0,0 @@ -# Petstore::MixedPropertiesAndAdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**date_time** | **DateTime** | | [optional] -**map** | [**Hash<String, Animal>**](Animal.md) | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new(uuid: null, - date_time: null, - map: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Model200Response.md b/samples/openapi3/client/petstore/ruby/docs/Model200Response.md deleted file mode 100644 index 07a53b603347..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Model200Response.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::Model200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | [optional] -**_class** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Model200Response.new(name: null, - _class: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/ModelReturn.md b/samples/openapi3/client/petstore/ruby/docs/ModelReturn.md deleted file mode 100644 index 2e155936c898..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/ModelReturn.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::ModelReturn - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Integer** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ModelReturn.new(_return: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Name.md b/samples/openapi3/client/petstore/ruby/docs/Name.md deleted file mode 100644 index 17cdbbd35612..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Name.md +++ /dev/null @@ -1,23 +0,0 @@ -# Petstore::Name - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | -**snake_case** | **Integer** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123_number** | **Integer** | | [optional] [readonly] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Name.new(name: null, - snake_case: null, - property: null, - _123_number: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/NumberOnly.md b/samples/openapi3/client/petstore/ruby/docs/NumberOnly.md deleted file mode 100644 index 73c5d0a3ab28..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/NumberOnly.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::NumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **Float** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::NumberOnly.new(just_number: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Order.md b/samples/openapi3/client/petstore/ruby/docs/Order.md deleted file mode 100644 index e8f38005ae17..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Order.md +++ /dev/null @@ -1,27 +0,0 @@ -# Petstore::Order - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**pet_id** | **Integer** | | [optional] -**quantity** | **Integer** | | [optional] -**ship_date** | **DateTime** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Boolean** | | [optional] [default to false] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Order.new(id: null, - pet_id: null, - quantity: null, - ship_date: null, - status: null, - complete: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/OuterComposite.md b/samples/openapi3/client/petstore/ruby/docs/OuterComposite.md deleted file mode 100644 index 2716cd298087..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/OuterComposite.md +++ /dev/null @@ -1,21 +0,0 @@ -# Petstore::OuterComposite - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | **Float** | | [optional] -**my_string** | **String** | | [optional] -**my_boolean** | **Boolean** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::OuterComposite.new(my_number: null, - my_string: null, - my_boolean: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/OuterEnum.md b/samples/openapi3/client/petstore/ruby/docs/OuterEnum.md deleted file mode 100644 index e919b6bc78ba..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/OuterEnum.md +++ /dev/null @@ -1,16 +0,0 @@ -# Petstore::OuterEnum - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::OuterEnum.new() -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/Pet.md b/samples/openapi3/client/petstore/ruby/docs/Pet.md deleted file mode 100644 index efee63091e47..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Pet.md +++ /dev/null @@ -1,27 +0,0 @@ -# Petstore::Pet - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photo_urls** | **Array<String>** | | -**tags** | [**Array<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Pet.new(id: null, - category: null, - name: doggie, - photo_urls: null, - tags: null, - status: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/PetApi.md b/samples/openapi3/client/petstore/ruby/docs/PetApi.md deleted file mode 100644 index 6e650f534b1b..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/PetApi.md +++ /dev/null @@ -1,493 +0,0 @@ -# Petstore::PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - - -## add_pet - -> add_pet(pet) - -Add a new pet to the store - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store - -begin - #Add a new pet to the store - api_instance.add_pet(pet) -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->add_pet: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -nil (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## delete_pet - -> delete_pet(pet_id, opts) - -Deletes a pet - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | Pet id to delete -opts = { - api_key: 'api_key_example' # String | -} - -begin - #Deletes a pet - api_instance.delete_pet(pet_id, opts) -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->delete_pet: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| Pet id to delete | - **api_key** | **String**| | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## find_pets_by_status - -> Array<Pet> find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -status = ['status_example'] # Array | Status values that need to be considered for filter - -begin - #Finds Pets by status - result = api_instance.find_pets_by_status(status) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->find_pets_by_status: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**Array<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**Array<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## find_pets_by_tags - -> Array<Pet> find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -tags = ['tags_example'] # Array | Tags to filter by - -begin - #Finds Pets by tags - result = api_instance.find_pets_by_tags(tags) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->find_pets_by_tags: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**Array<String>**](String.md)| Tags to filter by | - -### Return type - -[**Array<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## get_pet_by_id - -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure API key authorization: api_key - config.api_key['api_key'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api_key'] = 'Bearer' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet to return - -begin - #Find pet by ID - result = api_instance.get_pet_by_id(pet_id) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->get_pet_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## update_pet - -> update_pet(pet) - -Update an existing pet - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store - -begin - #Update an existing pet - api_instance.update_pet(pet) -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->update_pet: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -nil (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## update_pet_with_form - -> update_pet_with_form(pet_id, opts) - -Updates a pet in the store with form data - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet that needs to be updated -opts = { - name: 'name_example', # String | Updated name of the pet - status: 'status_example' # String | Updated status of the pet -} - -begin - #Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, opts) -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->update_pet_with_form: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -nil (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## upload_file - -> ApiResponse upload_file(pet_id, opts) - -uploads an image - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet to update -opts = { - additional_metadata: 'additional_metadata_example', # String | Additional data to pass to server - file: File.new('/path/to/file') # File | file to upload -} - -begin - #uploads an image - result = api_instance.upload_file(pet_id, opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->upload_file: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet to update | - **additional_metadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - - -## upload_file_with_required_file - -> ApiResponse upload_file_with_required_file(pet_id, required_file, opts) - -uploads an image (required) - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet to update -required_file = File.new('/path/to/file') # File | file to upload -opts = { - additional_metadata: 'additional_metadata_example' # String | Additional data to pass to server -} - -begin - #uploads an image (required) - result = api_instance.upload_file_with_required_file(pet_id, required_file, opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->upload_file_with_required_file: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet to update | - **required_file** | **File**| file to upload | - **additional_metadata** | **String**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/ruby/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/ruby/docs/ReadOnlyFirst.md deleted file mode 100644 index f8f76a463a14..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::ReadOnlyFirst - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::ReadOnlyFirst.new(bar: null, - baz: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/SpecialModelName.md b/samples/openapi3/client/petstore/ruby/docs/SpecialModelName.md deleted file mode 100644 index 498ab811683a..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/SpecialModelName.md +++ /dev/null @@ -1,17 +0,0 @@ -# Petstore::SpecialModelName - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **Integer** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::SpecialModelName.new(special_property_name: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/StoreApi.md b/samples/openapi3/client/petstore/ruby/docs/StoreApi.md deleted file mode 100644 index ffbc1d04b1ef..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/StoreApi.md +++ /dev/null @@ -1,200 +0,0 @@ -# Petstore::StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - - -## delete_order - -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::StoreApi.new -order_id = 'order_id_example' # String | ID of the order that needs to be deleted - -begin - #Delete purchase order by ID - api_instance.delete_order(order_id) -rescue Petstore::ApiError => e - puts "Exception when calling StoreApi->delete_order: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **String**| ID of the order that needs to be deleted | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## get_inventory - -> Hash<String, Integer> get_inventory - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure API key authorization: api_key - config.api_key['api_key'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api_key'] = 'Bearer' -end - -api_instance = Petstore::StoreApi.new - -begin - #Returns pet inventories by status - result = api_instance.get_inventory - p result -rescue Petstore::ApiError => e - puts "Exception when calling StoreApi->get_inventory: #{e}" -end -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -**Hash<String, Integer>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_order_by_id - -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::StoreApi.new -order_id = 56 # Integer | ID of pet that needs to be fetched - -begin - #Find purchase order by ID - result = api_instance.get_order_by_id(order_id) - p result -rescue Petstore::ApiError => e - puts "Exception when calling StoreApi->get_order_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **Integer**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## place_order - -> Order place_order(order) - -Place an order for a pet - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::StoreApi.new -order = Petstore::Order.new # Order | order placed for purchasing the pet - -begin - #Place an order for a pet - result = api_instance.place_order(order) - p result -rescue Petstore::ApiError => e - puts "Exception when calling StoreApi->place_order: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/xml, application/json - diff --git a/samples/openapi3/client/petstore/ruby/docs/Tag.md b/samples/openapi3/client/petstore/ruby/docs/Tag.md deleted file mode 100644 index 54a66a3f294b..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/Tag.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::Tag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**name** | **String** | | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::Tag.new(id: null, - name: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/User.md b/samples/openapi3/client/petstore/ruby/docs/User.md deleted file mode 100644 index 263e96046620..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/User.md +++ /dev/null @@ -1,31 +0,0 @@ -# Petstore::User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | | [optional] -**username** | **String** | | [optional] -**first_name** | **String** | | [optional] -**last_name** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**user_status** | **Integer** | User Status | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::User.new(id: null, - username: null, - first_name: null, - last_name: null, - email: null, - password: null, - phone: null, - user_status: null) -``` - - diff --git a/samples/openapi3/client/petstore/ruby/docs/UserApi.md b/samples/openapi3/client/petstore/ruby/docs/UserApi.md deleted file mode 100644 index 631a65ef1f19..000000000000 --- a/samples/openapi3/client/petstore/ruby/docs/UserApi.md +++ /dev/null @@ -1,376 +0,0 @@ -# Petstore::UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - - -## create_user - -> create_user(user) - -Create user - -This can only be done by the logged in user. - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -user = Petstore::User.new # User | Created user object - -begin - #Create user - api_instance.create_user(user) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->create_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## create_users_with_array_input - -> create_users_with_array_input(user) - -Creates list of users with given input array - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -user = [Petstore::User.new] # Array | List of user object - -begin - #Creates list of users with given input array - api_instance.create_users_with_array_input(user) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->create_users_with_array_input: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**Array<User>**](User.md)| List of user object | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## create_users_with_list_input - -> create_users_with_list_input(user) - -Creates list of users with given input array - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -user = [Petstore::User.new] # Array | List of user object - -begin - #Creates list of users with given input array - api_instance.create_users_with_list_input(user) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->create_users_with_list_input: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**Array<User>**](User.md)| List of user object | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - -## delete_user - -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -username = 'username_example' # String | The name that needs to be deleted - -begin - #Delete user - api_instance.delete_user(username) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->delete_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## get_user_by_name - -> User get_user_by_name(username) - -Get user by user name - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -username = 'username_example' # String | The name that needs to be fetched. Use user1 for testing. - -begin - #Get user by user name - result = api_instance.get_user_by_name(username) - p result -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->get_user_by_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## login_user - -> String login_user(username, password) - -Logs user into the system - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -username = 'username_example' # String | The user name for login -password = 'password_example' # String | The password for login in clear text - -begin - #Logs user into the system - result = api_instance.login_user(username, password) - p result -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->login_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## logout_user - -> logout_user - -Logs out current logged in user session - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new - -begin - #Logs out current logged in user session - api_instance.logout_user -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->logout_user: #{e}" -end -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## update_user - -> update_user(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example - -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::UserApi.new -username = 'username_example' # String | name that need to be deleted -user = Petstore::User.new # User | Updated user object - -begin - #Updated user - api_instance.update_user(username, user) -rescue Petstore::ApiError => e - puts "Exception when calling UserApi->update_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - diff --git a/samples/openapi3/client/petstore/ruby/git_push.sh b/samples/openapi3/client/petstore/ruby/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/openapi3/client/petstore/ruby/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore.rb b/samples/openapi3/client/petstore/ruby/lib/petstore.rb deleted file mode 100644 index 7f8ae56e123b..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore.rb +++ /dev/null @@ -1,95 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -# Common files -require 'petstore/api_client' -require 'petstore/api_error' -require 'petstore/version' -require 'petstore/configuration' - -# Models -require 'petstore/models/additional_properties_class' -require 'petstore/models/animal' -require 'petstore/models/api_response' -require 'petstore/models/array_of_array_of_number_only' -require 'petstore/models/array_of_number_only' -require 'petstore/models/array_test' -require 'petstore/models/capitalization' -require 'petstore/models/cat' -require 'petstore/models/cat_all_of' -require 'petstore/models/category' -require 'petstore/models/class_model' -require 'petstore/models/client' -require 'petstore/models/dog' -require 'petstore/models/dog_all_of' -require 'petstore/models/enum_arrays' -require 'petstore/models/enum_class' -require 'petstore/models/enum_test' -require 'petstore/models/file' -require 'petstore/models/file_schema_test_class' -require 'petstore/models/foo' -require 'petstore/models/format_test' -require 'petstore/models/has_only_read_only' -require 'petstore/models/health_check_result' -require 'petstore/models/inline_object' -require 'petstore/models/inline_object1' -require 'petstore/models/inline_object2' -require 'petstore/models/inline_object3' -require 'petstore/models/inline_object4' -require 'petstore/models/inline_object5' -require 'petstore/models/inline_response_default' -require 'petstore/models/list' -require 'petstore/models/map_test' -require 'petstore/models/mixed_properties_and_additional_properties_class' -require 'petstore/models/model200_response' -require 'petstore/models/model_return' -require 'petstore/models/name' -require 'petstore/models/nullable_class' -require 'petstore/models/number_only' -require 'petstore/models/order' -require 'petstore/models/outer_composite' -require 'petstore/models/outer_enum' -require 'petstore/models/outer_enum_default_value' -require 'petstore/models/outer_enum_integer' -require 'petstore/models/outer_enum_integer_default_value' -require 'petstore/models/pet' -require 'petstore/models/read_only_first' -require 'petstore/models/special_model_name' -require 'petstore/models/tag' -require 'petstore/models/user' - -# APIs -require 'petstore/api/another_fake_api' -require 'petstore/api/default_api' -require 'petstore/api/fake_api' -require 'petstore/api/fake_classname_tags123_api' -require 'petstore/api/pet_api' -require 'petstore/api/store_api' -require 'petstore/api/user_api' - -module Petstore - class << self - # Customize default settings for the SDK using block. - # Petstore.configure do |config| - # config.username = "xxx" - # config.password = "xxx" - # end - # If no block given, return the default Configuration object. - def configure - if block_given? - yield(Configuration.default) - else - Configuration.default - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb deleted file mode 100644 index dfa6972327d2..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ /dev/null @@ -1,86 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class AnotherFakeApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # To test special tags - # To test special tags and operation ID starting with number - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Client] - def call_123_test_special_tags(client, opts = {}) - data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts) - data - end - - # To test special tags - # To test special tags and operation ID starting with number - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def call_123_test_special_tags_with_http_info(client, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' - end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags" - end - # resource path - local_var_path = '/another-fake/dummy' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(client) - - # return_type - return_type = opts[:return_type] || 'Client' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AnotherFakeApi#call_123_test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb deleted file mode 100644 index 3117e4bca528..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ /dev/null @@ -1,1142 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class FakeApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Health check endpoint - # @param [Hash] opts the optional parameters - # @return [HealthCheckResult] - def fake_health_get(opts = {}) - data, _status_code, _headers = fake_health_get_with_http_info(opts) - data - end - - # Health check endpoint - # @param [Hash] opts the optional parameters - # @return [Array<(HealthCheckResult, Integer, Hash)>] HealthCheckResult data, response status code and response headers - def fake_health_get_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_health_get ...' - end - # resource path - local_var_path = '/fake/health' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HealthCheckResult' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [nil] - def fake_http_signature_test(pet, opts = {}) - fake_http_signature_test_with_http_info(pet, opts) - nil - end - - # test http signature authentication - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def fake_http_signature_test_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" - end - # resource path - local_var_path = '/fake/http-signature-test' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) - header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['http_signature_test'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Test serialization of outer boolean types - # @param [Hash] opts the optional parameters - # @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) - data - end - - # Test serialization of outer boolean types - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :body Input boolean as post body - # @return [Array<(Boolean, Integer, Hash)>] Boolean data, response status code and response headers - def fake_outer_boolean_serialize_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_boolean_serialize ...' - end - # resource path - local_var_path = '/fake/outer/boolean' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) - - # return_type - return_type = opts[:return_type] || 'Boolean' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_outer_boolean_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Test serialization of object with outer number type - # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body - # @return [OuterComposite] - def fake_outer_composite_serialize(opts = {}) - data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) - data - end - - # Test serialization of object with outer number type - # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body - # @return [Array<(OuterComposite, Integer, Hash)>] OuterComposite data, response status code and response headers - def fake_outer_composite_serialize_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_composite_serialize ...' - end - # resource path - local_var_path = '/fake/outer/composite' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'outer_composite']) - - # return_type - return_type = opts[:return_type] || 'OuterComposite' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_outer_composite_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Test serialization of outer number types - # @param [Hash] opts the optional parameters - # @option opts [Float] :body Input number as post body - # @return [Float] - def fake_outer_number_serialize(opts = {}) - data, _status_code, _headers = fake_outer_number_serialize_with_http_info(opts) - data - end - - # Test serialization of outer number types - # @param [Hash] opts the optional parameters - # @option opts [Float] :body Input number as post body - # @return [Array<(Float, Integer, Hash)>] Float data, response status code and response headers - def fake_outer_number_serialize_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_number_serialize ...' - end - # resource path - local_var_path = '/fake/outer/number' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) - - # return_type - return_type = opts[:return_type] || 'Float' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_outer_number_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Test serialization of outer string types - # @param [Hash] opts the optional parameters - # @option opts [String] :body Input string as post body - # @return [String] - def fake_outer_string_serialize(opts = {}) - data, _status_code, _headers = fake_outer_string_serialize_with_http_info(opts) - data - end - - # Test serialization of outer string types - # @param [Hash] opts the optional parameters - # @option opts [String] :body Input string as post body - # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers - def fake_outer_string_serialize_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_string_serialize ...' - end - # resource path - local_var_path = '/fake/outer/string' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) - - # return_type - return_type = opts[:return_type] || 'String' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#fake_outer_string_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class [FileSchemaTestClass] - # @param [Hash] opts the optional parameters - # @return [nil] - def test_body_with_file_schema(file_schema_test_class, opts = {}) - test_body_with_file_schema_with_http_info(file_schema_test_class, opts) - nil - end - - # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class [FileSchemaTestClass] - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...' - end - # verify the required parameter 'file_schema_test_class' is set - if @api_client.config.client_side_validation && file_schema_test_class.nil? - fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema" - end - # resource path - local_var_path = '/fake/body-with-file-schema' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(file_schema_test_class) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_body_with_file_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param query [String] - # @param user [User] - # @param [Hash] opts the optional parameters - # @return [nil] - def test_body_with_query_params(query, user, opts = {}) - test_body_with_query_params_with_http_info(query, user, opts) - nil - end - - # @param query [String] - # @param user [User] - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_body_with_query_params_with_http_info(query, user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...' - end - # verify the required parameter 'query' is set - if @api_client.config.client_side_validation && query.nil? - fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params" - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params" - end - # resource path - local_var_path = '/fake/body-with-query-params' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'query'] = query - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_body_with_query_params\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # To test \"client\" model - # To test \"client\" model - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Client] - def test_client_model(client, opts = {}) - data, _status_code, _headers = test_client_model_with_http_info(client, opts) - data - end - - # To test \"client\" model - # To test \"client\" model - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def test_client_model_with_http_info(client, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...' - end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model" - end - # resource path - local_var_path = '/fake' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(client) - - # return_type - return_type = opts[:return_type] || 'Client' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_client_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # @param number [Float] None - # @param double [Float] None - # @param pattern_without_delimiter [String] None - # @param byte [String] None - # @param [Hash] opts the optional parameters - # @option opts [Integer] :integer None - # @option opts [Integer] :int32 None - # @option opts [Integer] :int64 None - # @option opts [Float] :float None - # @option opts [String] :string None - # @option opts [File] :binary None - # @option opts [Date] :date None - # @option opts [DateTime] :date_time None - # @option opts [String] :password None - # @option opts [String] :callback None - # @return [nil] - def test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts = {}) - test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts) - nil - end - - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # @param number [Float] None - # @param double [Float] None - # @param pattern_without_delimiter [String] None - # @param byte [String] None - # @param [Hash] opts the optional parameters - # @option opts [Integer] :integer None - # @option opts [Integer] :int32 None - # @option opts [Integer] :int64 None - # @option opts [Float] :float None - # @option opts [String] :string None - # @option opts [File] :binary None - # @option opts [Date] :date None - # @option opts [DateTime] :date_time None - # @option opts [String] :password None - # @option opts [String] :callback None - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_endpoint_parameters ...' - end - # verify the required parameter 'number' is set - if @api_client.config.client_side_validation && number.nil? - fail ArgumentError, "Missing the required parameter 'number' when calling FakeApi.test_endpoint_parameters" - end - if @api_client.config.client_side_validation && number > 543.2 - fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 543.2.' - end - - if @api_client.config.client_side_validation && number < 32.1 - fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 32.1.' - end - - # verify the required parameter 'double' is set - if @api_client.config.client_side_validation && double.nil? - fail ArgumentError, "Missing the required parameter 'double' when calling FakeApi.test_endpoint_parameters" - end - if @api_client.config.client_side_validation && double > 123.4 - fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 123.4.' - end - - if @api_client.config.client_side_validation && double < 67.8 - fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 67.8.' - end - - # verify the required parameter 'pattern_without_delimiter' is set - if @api_client.config.client_side_validation && pattern_without_delimiter.nil? - fail ArgumentError, "Missing the required parameter 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters" - end - pattern = Regexp.new(/^[A-Z].*/) - if @api_client.config.client_side_validation && pattern_without_delimiter !~ pattern - fail ArgumentError, "invalid value for 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}." - end - - # verify the required parameter 'byte' is set - if @api_client.config.client_side_validation && byte.nil? - fail ArgumentError, "Missing the required parameter 'byte' when calling FakeApi.test_endpoint_parameters" - end - if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] > 100 - fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.' - end - - if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] < 10 - fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.' - end - - if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] > 200 - fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.' - end - - if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] < 20 - fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.' - end - - if @api_client.config.client_side_validation && !opts[:'float'].nil? && opts[:'float'] > 987.6 - fail ArgumentError, 'invalid value for "opts[:"float"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 987.6.' - end - - pattern = Regexp.new(/[a-z]/i) - if @api_client.config.client_side_validation && !opts[:'string'].nil? && opts[:'string'] !~ pattern - fail ArgumentError, "invalid value for 'opts[:\"string\"]' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}." - end - - if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length > 64 - fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be smaller than or equal to 64.' - end - - if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length < 10 - fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be great than or equal to 10.' - end - - # resource path - local_var_path = '/fake' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['number'] = number - form_params['double'] = double - form_params['pattern_without_delimiter'] = pattern_without_delimiter - form_params['byte'] = byte - form_params['integer'] = opts[:'integer'] if !opts[:'integer'].nil? - form_params['int32'] = opts[:'int32'] if !opts[:'int32'].nil? - form_params['int64'] = opts[:'int64'] if !opts[:'int64'].nil? - form_params['float'] = opts[:'float'] if !opts[:'float'].nil? - form_params['string'] = opts[:'string'] if !opts[:'string'].nil? - form_params['binary'] = opts[:'binary'] if !opts[:'binary'].nil? - form_params['date'] = opts[:'date'] if !opts[:'date'].nil? - form_params['dateTime'] = opts[:'date_time'] if !opts[:'date_time'].nil? - form_params['password'] = opts[:'password'] if !opts[:'password'].nil? - form_params['callback'] = opts[:'callback'] if !opts[:'callback'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['http_basic_test'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_endpoint_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # To test enum parameters - # 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 [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 [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) (default to '$') - # @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) - nil - end - - # To test enum parameters - # 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) - # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) - # @option opts [String] :enum_query_string Query parameter enum test (string) - # @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) - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_enum_parameters_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_enum_parameters ...' - end - allowable_values = [">", "$"] - if @api_client.config.client_side_validation && opts[:'enum_header_string_array'] && !opts[:'enum_header_string_array'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"enum_header_string_array\", must include one of #{allowable_values}" - end - allowable_values = ["_abc", "-efg", "(xyz)"] - if @api_client.config.client_side_validation && opts[:'enum_header_string'] && !allowable_values.include?(opts[:'enum_header_string']) - fail ArgumentError, "invalid value for \"enum_header_string\", must be one of #{allowable_values}" - end - allowable_values = [">", "$"] - if @api_client.config.client_side_validation && opts[:'enum_query_string_array'] && !opts[:'enum_query_string_array'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"enum_query_string_array\", must include one of #{allowable_values}" - end - allowable_values = ["_abc", "-efg", "(xyz)"] - if @api_client.config.client_side_validation && opts[:'enum_query_string'] && !allowable_values.include?(opts[:'enum_query_string']) - fail ArgumentError, "invalid value for \"enum_query_string\", must be one of #{allowable_values}" - end - allowable_values = [1, -2] - if @api_client.config.client_side_validation && opts[:'enum_query_integer'] && !allowable_values.include?(opts[:'enum_query_integer']) - fail ArgumentError, "invalid value for \"enum_query_integer\", must be one of #{allowable_values}" - end - allowable_values = [1.1, -1.2] - if @api_client.config.client_side_validation && opts[:'enum_query_double'] && !allowable_values.include?(opts[:'enum_query_double']) - fail ArgumentError, "invalid value for \"enum_query_double\", must be one of #{allowable_values}" - end - allowable_values = [">", "$"] - if @api_client.config.client_side_validation && opts[:'enum_form_string_array'] && !opts[:'enum_form_string_array'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"enum_form_string_array\", must include one of #{allowable_values}" - end - allowable_values = ["_abc", "-efg", "(xyz)"] - if @api_client.config.client_side_validation && opts[:'enum_form_string'] && !allowable_values.include?(opts[:'enum_form_string']) - fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/fake' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'enum_query_string_array'] = @api_client.build_collection_param(opts[:'enum_query_string_array'], :multi) if !opts[:'enum_query_string_array'].nil? - query_params[:'enum_query_string'] = opts[:'enum_query_string'] if !opts[:'enum_query_string'].nil? - query_params[:'enum_query_integer'] = opts[:'enum_query_integer'] if !opts[:'enum_query_integer'].nil? - query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - header_params[:'enum_header_string_array'] = @api_client.build_collection_param(opts[:'enum_header_string_array'], :csv) if !opts[:'enum_header_string_array'].nil? - header_params[:'enum_header_string'] = opts[:'enum_header_string'] if !opts[:'enum_header_string'].nil? - - # form parameters - form_params = opts[:form_params] || {} - form_params['enum_form_string_array'] = @api_client.build_collection_param(opts[:'enum_form_string_array'], :csv) if !opts[:'enum_form_string_array'].nil? - form_params['enum_form_string'] = opts[:'enum_form_string'] if !opts[:'enum_form_string'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_enum_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Fake endpoint to test group parameters (optional) - # Fake endpoint to test group parameters (optional) - # @param required_string_group [Integer] Required String in group parameters - # @param required_boolean_group [Boolean] Required Boolean in group parameters - # @param required_int64_group [Integer] Required Integer in group parameters - # @param [Hash] opts the optional parameters - # @option opts [Integer] :string_group String in group parameters - # @option opts [Boolean] :boolean_group Boolean in group parameters - # @option opts [Integer] :int64_group Integer in group parameters - # @return [nil] - def test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts = {}) - test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts) - nil - end - - # Fake endpoint to test group parameters (optional) - # Fake endpoint to test group parameters (optional) - # @param required_string_group [Integer] Required String in group parameters - # @param required_boolean_group [Boolean] Required Boolean in group parameters - # @param required_int64_group [Integer] Required Integer in group parameters - # @param [Hash] opts the optional parameters - # @option opts [Integer] :string_group String in group parameters - # @option opts [Boolean] :boolean_group Boolean in group parameters - # @option opts [Integer] :int64_group Integer in group parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_group_parameters ...' - end - # verify the required parameter 'required_string_group' is set - if @api_client.config.client_side_validation && required_string_group.nil? - fail ArgumentError, "Missing the required parameter 'required_string_group' when calling FakeApi.test_group_parameters" - end - # verify the required parameter 'required_boolean_group' is set - if @api_client.config.client_side_validation && required_boolean_group.nil? - fail ArgumentError, "Missing the required parameter 'required_boolean_group' when calling FakeApi.test_group_parameters" - end - # verify the required parameter 'required_int64_group' is set - if @api_client.config.client_side_validation && required_int64_group.nil? - fail ArgumentError, "Missing the required parameter 'required_int64_group' when calling FakeApi.test_group_parameters" - end - # resource path - local_var_path = '/fake' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'required_string_group'] = required_string_group - query_params[:'required_int64_group'] = required_int64_group - query_params[:'string_group'] = opts[:'string_group'] if !opts[:'string_group'].nil? - query_params[:'int64_group'] = opts[:'int64_group'] if !opts[:'int64_group'].nil? - - # header parameters - header_params = opts[:header_params] || {} - header_params[:'required_boolean_group'] = required_boolean_group - header_params[:'boolean_group'] = opts[:'boolean_group'] if !opts[:'boolean_group'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['bearer_test'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_group_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # test inline additionalProperties - # @param request_body [Hash] request body - # @param [Hash] opts the optional parameters - # @return [nil] - def test_inline_additional_properties(request_body, opts = {}) - test_inline_additional_properties_with_http_info(request_body, opts) - nil - end - - # test inline additionalProperties - # @param request_body [Hash] request body - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_inline_additional_properties_with_http_info(request_body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...' - end - # verify the required parameter 'request_body' is set - if @api_client.config.client_side_validation && request_body.nil? - fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties" - end - # resource path - local_var_path = '/fake/inline-additionalProperties' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(request_body) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_inline_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # test json serialization of form data - # @param param [String] field1 - # @param param2 [String] 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) - nil - end - - # test json serialization of form data - # @param param [String] field1 - # @param param2 [String] field2 - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, 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 = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['param'] = param - form_params['param2'] = param2 - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - 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 - - # To test the collection format in query parameters - # @param pipe [Array] - # @param ioutil [Array] - # @param http [Array] - # @param url [Array] - # @param context [Array] - # @param [Hash] opts the optional parameters - # @return [nil] - def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) - test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) - nil - end - - # To test the collection format in query parameters - # @param pipe [Array] - # @param ioutil [Array] - # @param http [Array] - # @param url [Array] - # @param context [Array] - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' - end - # verify the required parameter 'pipe' is set - if @api_client.config.client_side_validation && pipe.nil? - fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" - end - # verify the required parameter 'ioutil' is set - if @api_client.config.client_side_validation && ioutil.nil? - fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" - end - # verify the required parameter 'http' is set - if @api_client.config.client_side_validation && http.nil? - fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" - end - # verify the required parameter 'url' is set - if @api_client.config.client_side_validation && url.nil? - fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" - end - # verify the required parameter 'context' is set - if @api_client.config.client_side_validation && context.nil? - fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" - end - # resource path - local_var_path = '/fake/test-query-paramters' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'pipe'] = @api_client.build_collection_param(pipe, :multi) - query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) - query_params[:'http'] = @api_client.build_collection_param(http, :space) - query_params[:'url'] = @api_client.build_collection_param(url, :csv) - query_params[:'context'] = @api_client.build_collection_param(context, :multi) - - # header parameters - header_params = opts[:header_params] || {} - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb deleted file mode 100644 index 1e44496d5f82..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ /dev/null @@ -1,86 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class FakeClassnameTags123Api - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # To test class name in snake case - # To test class name in snake case - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Client] - def test_classname(client, opts = {}) - data, _status_code, _headers = test_classname_with_http_info(client, opts) - data - end - - # To test class name in snake case - # To test class name in snake case - # @param client [Client] client model - # @param [Hash] opts the optional parameters - # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers - def test_classname_with_http_info(client, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...' - end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname" - end - # resource path - local_var_path = '/fake_classname_test' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(client) - - # return_type - return_type = opts[:return_type] || 'Client' - - # auth_names - auth_names = opts[:auth_names] || ['api_key_query'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeClassnameTags123Api#test_classname\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb deleted file mode 100644 index 4858424f2a05..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ /dev/null @@ -1,597 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class PetApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Add a new pet to the store - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [nil] - def add_pet(pet, opts = {}) - add_pet_with_http_info(pet, opts) - nil - end - - # Add a new pet to the store - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def add_pet_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet" - end - # resource path - local_var_path = '/pet' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#add_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Deletes a pet - # @param pet_id [Integer] Pet id to delete - # @param [Hash] opts the optional parameters - # @option opts [String] :api_key - # @return [nil] - def delete_pet(pet_id, opts = {}) - delete_pet_with_http_info(pet_id, opts) - nil - end - - # Deletes a pet - # @param pet_id [Integer] Pet id to delete - # @param [Hash] opts the optional parameters - # @option opts [String] :api_key - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_pet_with_http_info(pet_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.delete_pet ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" - end - # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - header_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#delete_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Finds Pets by status - # Multiple status values can be provided with comma separated strings - # @param status [Array] Status values that need to be considered for filter - # @param [Hash] opts the optional parameters - # @return [Array] - def find_pets_by_status(status, opts = {}) - data, _status_code, _headers = find_pets_by_status_with_http_info(status, opts) - data - end - - # Finds Pets by status - # Multiple status values can be provided with comma separated strings - # @param status [Array] Status values that need to be considered for filter - # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - def find_pets_by_status_with_http_info(status, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_status ...' - end - # verify the required parameter 'status' is set - if @api_client.config.client_side_validation && status.nil? - fail ArgumentError, "Missing the required parameter 'status' when calling PetApi.find_pets_by_status" - end - # resource path - local_var_path = '/pet/findByStatus' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'status'] = @api_client.build_collection_param(status, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Array' - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#find_pets_by_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Finds Pets by tags - # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - # @param tags [Array] Tags to filter by - # @param [Hash] opts the optional parameters - # @return [Array] - def find_pets_by_tags(tags, opts = {}) - data, _status_code, _headers = find_pets_by_tags_with_http_info(tags, opts) - data - end - - # Finds Pets by tags - # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - # @param tags [Array] Tags to filter by - # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - def find_pets_by_tags_with_http_info(tags, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_tags ...' - end - # verify the required parameter 'tags' is set - if @api_client.config.client_side_validation && tags.nil? - fail ArgumentError, "Missing the required parameter 'tags' when calling PetApi.find_pets_by_tags" - end - # resource path - local_var_path = '/pet/findByTags' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'tags'] = @api_client.build_collection_param(tags, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Array' - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#find_pets_by_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Find pet by ID - # Returns a single pet - # @param pet_id [Integer] ID of pet to return - # @param [Hash] opts the optional parameters - # @return [Pet] - def get_pet_by_id(pet_id, opts = {}) - data, _status_code, _headers = get_pet_by_id_with_http_info(pet_id, opts) - data - end - - # Find pet by ID - # Returns a single pet - # @param pet_id [Integer] ID of pet to return - # @param [Hash] opts the optional parameters - # @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers - def get_pet_by_id_with_http_info(pet_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.get_pet_by_id ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" - end - # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Pet' - - # auth_names - auth_names = opts[:auth_names] || ['api_key'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#get_pet_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update an existing pet - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [nil] - def update_pet(pet, opts = {}) - update_pet_with_http_info(pet, opts) - nil - end - - # Update an existing pet - # @param pet [Pet] Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_pet_with_http_info(pet, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...' - end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet" - end - # resource path - local_var_path = '/pet' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(pet) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#update_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Updates a pet in the store with form data - # @param pet_id [Integer] ID of pet that needs to be updated - # @param [Hash] opts the optional parameters - # @option opts [String] :name Updated name of the pet - # @option opts [String] :status Updated status of the pet - # @return [nil] - def update_pet_with_form(pet_id, opts = {}) - update_pet_with_form_with_http_info(pet_id, opts) - nil - end - - # Updates a pet in the store with form data - # @param pet_id [Integer] ID of pet that needs to be updated - # @param [Hash] opts the optional parameters - # @option opts [String] :name Updated name of the pet - # @option opts [String] :status Updated status of the pet - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_pet_with_form_with_http_info(pet_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.update_pet_with_form ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" - end - # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['name'] = opts[:'name'] if !opts[:'name'].nil? - form_params['status'] = opts[:'status'] if !opts[:'status'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#update_pet_with_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # uploads an image - # @param pet_id [Integer] ID of pet to update - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @option opts [File] :file file to upload - # @return [ApiResponse] - def upload_file(pet_id, opts = {}) - data, _status_code, _headers = upload_file_with_http_info(pet_id, opts) - data - end - - # uploads an image - # @param pet_id [Integer] ID of pet to update - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @option opts [File] :file file to upload - # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers - def upload_file_with_http_info(pet_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.upload_file ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" - end - # resource path - local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? - form_params['file'] = opts[:'file'] if !opts[:'file'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ApiResponse' - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # uploads an image (required) - # @param pet_id [Integer] ID of pet to update - # @param required_file [File] file to upload - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @return [ApiResponse] - def upload_file_with_required_file(pet_id, required_file, opts = {}) - data, _status_code, _headers = upload_file_with_required_file_with_http_info(pet_id, required_file, opts) - data - end - - # uploads an image (required) - # @param pet_id [Integer] ID of pet to update - # @param required_file [File] file to upload - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers - def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PetApi.upload_file_with_required_file ...' - end - # verify the required parameter 'pet_id' is set - if @api_client.config.client_side_validation && pet_id.nil? - fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file_with_required_file" - end - # verify the required parameter 'required_file' is set - if @api_client.config.client_side_validation && required_file.nil? - fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" - end - # resource path - local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) - - # form parameters - form_params = opts[:form_params] || {} - form_params['requiredFile'] = required_file - form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ApiResponse' - - # auth_names - auth_names = opts[:auth_names] || ['petstore_auth'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PetApi#upload_file_with_required_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb deleted file mode 100644 index dc4952419a12..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class StoreApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete purchase order by ID - # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - # @param order_id [String] ID of the order that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_order(order_id, opts = {}) - delete_order_with_http_info(order_id, opts) - nil - end - - # Delete purchase order by ID - # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - # @param order_id [String] ID of the order that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_order_with_http_info(order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StoreApi.delete_order ...' - end - # verify the required parameter 'order_id' is set - if @api_client.config.client_side_validation && order_id.nil? - fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" - end - # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: StoreApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Returns pet inventories by status - # Returns a map of status codes to quantities - # @param [Hash] opts the optional parameters - # @return [Hash] - def get_inventory(opts = {}) - data, _status_code, _headers = get_inventory_with_http_info(opts) - data - end - - # Returns pet inventories by status - # Returns a map of status codes to quantities - # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_inventory_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StoreApi.get_inventory ...' - end - # resource path - local_var_path = '/store/inventory' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Hash' - - # auth_names - auth_names = opts[:auth_names] || ['api_key'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: StoreApi#get_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Find purchase order by ID - # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - # @param order_id [Integer] ID of pet that needs to be fetched - # @param [Hash] opts the optional parameters - # @return [Order] - def get_order_by_id(order_id, opts = {}) - data, _status_code, _headers = get_order_by_id_with_http_info(order_id, opts) - data - end - - # Find purchase order by ID - # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - # @param order_id [Integer] ID of pet that needs to be fetched - # @param [Hash] opts the optional parameters - # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers - def get_order_by_id_with_http_info(order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StoreApi.get_order_by_id ...' - end - # verify the required parameter 'order_id' is set - if @api_client.config.client_side_validation && order_id.nil? - fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.get_order_by_id" - end - if @api_client.config.client_side_validation && order_id > 5 - fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be smaller than or equal to 5.' - end - - if @api_client.config.client_side_validation && order_id < 1 - fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be greater than or equal to 1.' - end - - # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Order' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: StoreApi#get_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Place an order for a pet - # @param order [Order] order placed for purchasing the pet - # @param [Hash] opts the optional parameters - # @return [Order] - def place_order(order, opts = {}) - data, _status_code, _headers = place_order_with_http_info(order, opts) - data - end - - # Place an order for a pet - # @param order [Order] order placed for purchasing the pet - # @param [Hash] opts the optional parameters - # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers - def place_order_with_http_info(order, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...' - end - # verify the required parameter 'order' is set - if @api_client.config.client_side_validation && order.nil? - fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order" - end - # resource path - local_var_path = '/store/order' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(order) - - # return_type - return_type = opts[:return_type] || 'Order' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: StoreApi#place_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb deleted file mode 100644 index b2fbf6be7c65..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb +++ /dev/null @@ -1,512 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'cgi' - -module Petstore - class UserApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Create user - # This can only be done by the logged in user. - # @param user [User] Created user object - # @param [Hash] opts the optional parameters - # @return [nil] - def create_user(user, opts = {}) - create_user_with_http_info(user, opts) - nil - end - - # Create user - # This can only be done by the logged in user. - # @param user [User] Created user object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_user_with_http_info(user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.create_user ...' - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user" - end - # resource path - local_var_path = '/user' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Creates list of users with given input array - # @param user [Array] List of user object - # @param [Hash] opts the optional parameters - # @return [nil] - def create_users_with_array_input(user, opts = {}) - create_users_with_array_input_with_http_info(user, opts) - nil - end - - # Creates list of users with given input array - # @param user [Array] List of user object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_users_with_array_input_with_http_info(user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...' - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input" - end - # resource path - local_var_path = '/user/createWithArray' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#create_users_with_array_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Creates list of users with given input array - # @param user [Array] List of user object - # @param [Hash] opts the optional parameters - # @return [nil] - def create_users_with_list_input(user, opts = {}) - create_users_with_list_input_with_http_info(user, opts) - nil - end - - # Creates list of users with given input array - # @param user [Array] List of user object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_users_with_list_input_with_http_info(user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...' - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input" - end - # resource path - local_var_path = '/user/createWithList' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#create_users_with_list_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Delete user - # This can only be done by the logged in user. - # @param username [String] The name that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_user(username, opts = {}) - delete_user_with_http_info(username, opts) - nil - end - - # Delete user - # This can only be done by the logged in user. - # @param username [String] The name that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_user_with_http_info(username, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.delete_user ...' - end - # verify the required parameter 'username' is set - if @api_client.config.client_side_validation && username.nil? - fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" - end - # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get user by user name - # @param username [String] The name that needs to be fetched. Use user1 for testing. - # @param [Hash] opts the optional parameters - # @return [User] - def get_user_by_name(username, opts = {}) - data, _status_code, _headers = get_user_by_name_with_http_info(username, opts) - data - end - - # Get user by user name - # @param username [String] The name that needs to be fetched. Use user1 for testing. - # @param [Hash] opts the optional parameters - # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers - def get_user_by_name_with_http_info(username, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.get_user_by_name ...' - end - # verify the required parameter 'username' is set - if @api_client.config.client_side_validation && username.nil? - fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" - end - # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'User' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#get_user_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Logs user into the system - # @param username [String] The user name for login - # @param password [String] The password for login in clear text - # @param [Hash] opts the optional parameters - # @return [String] - def login_user(username, password, opts = {}) - data, _status_code, _headers = login_user_with_http_info(username, password, opts) - data - end - - # Logs user into the system - # @param username [String] The user name for login - # @param password [String] The password for login in clear text - # @param [Hash] opts the optional parameters - # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers - def login_user_with_http_info(username, password, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.login_user ...' - end - # verify the required parameter 'username' is set - if @api_client.config.client_side_validation && username.nil? - fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.login_user" - end - # verify the required parameter 'password' is set - if @api_client.config.client_side_validation && password.nil? - fail ArgumentError, "Missing the required parameter 'password' when calling UserApi.login_user" - end - # resource path - local_var_path = '/user/login' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'username'] = username - query_params[:'password'] = password - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'String' - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#login_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Logs out current logged in user session - # @param [Hash] opts the optional parameters - # @return [nil] - def logout_user(opts = {}) - logout_user_with_http_info(opts) - nil - end - - # Logs out current logged in user session - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def logout_user_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.logout_user ...' - end - # resource path - local_var_path = '/user/logout' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#logout_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Updated user - # This can only be done by the logged in user. - # @param username [String] name that need to be deleted - # @param user [User] Updated user object - # @param [Hash] opts the optional parameters - # @return [nil] - def update_user(username, user, opts = {}) - update_user_with_http_info(username, user, opts) - nil - end - - # Updated user - # This can only be done by the logged in user. - # @param username [String] name that need to be deleted - # @param user [User] Updated user object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_user_with_http_info(username, user, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UserApi.update_user ...' - end - # verify the required parameter 'username' is set - if @api_client.config.client_side_validation && username.nil? - fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user" - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" - end - # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || [] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb deleted file mode 100644 index a7183041d251..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb +++ /dev/null @@ -1,388 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' - -module Petstore - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - update_params_for_auth! header_params, query_params, opts[:auth_names] - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - Petstore.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @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 - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb deleted file mode 100644 index 337c5c7002c9..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb +++ /dev/null @@ -1,57 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -module Petstore - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb deleted file mode 100644 index 75e3e441f4fb..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -module Petstore - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'http' - @host = 'petstore.swagger.io' - @base_path = '/v2' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - 'api_key' => - { - type: 'api_key', - in: 'header', - key: 'api_key', - value: api_key_with_prefix('api_key') - }, - 'api_key_query' => - { - type: 'api_key', - in: 'query', - key: 'api_key_query', - value: api_key_with_prefix('api_key_query') - }, - 'bearer_test' => - { - type: 'bearer', - in: 'header', - format: 'JWT', - key: 'Authorization', - value: "Bearer #{access_token}" - }, - 'http_basic_test' => - { - type: 'basic', - in: 'header', - key: 'Authorization', - value: basic_auth_token - }, - 'petstore_auth' => - { - type: 'oauth2', - in: 'header', - key: 'Authorization', - value: "Bearer #{access_token}" - }, - } - end - - # Returns an array of Server setting - def server_settings - [ - { - url: "http://{server}.swagger.io:{port}/v2", - description: "petstore server", - variables: { - server: { - description: "No description provided", - default_value: "petstore", - enum_values: [ - "petstore", - "qa-petstore", - "dev-petstore" - ] - }, - port: { - description: "No description provided", - default_value: "80", - enum_values: [ - "80", - "8080" - ] - } - } - }, - { - url: "https://localhost:8080/{version}", - description: "The local server", - variables: { - version: { - description: "No description provided", - default_value: "v2", - enum_values: [ - "v1", - "v2" - ] - } - } - } - ] - end - - # Returns URL based on server settings - # - # @param index array index of the server settings - # @param variables hash of variable and the corresponding value - def server_url(index, variables = {}) - servers = server_settings - - # check array index out of bound - if (index < 0 || index >= servers.size) - fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" - end - - server = servers[index] - url = server[:url] - - # go through variable and assign a value - server[:variables].each do |name, variable| - if variables.key?(name) - if (server[:variables][name][:enum_values].include? variables[name]) - url.gsub! "{" + name.to_s + "}", variables[name] - else - fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." - end - else - # use default value - url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] - end - end - - url - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb deleted file mode 100644 index 2e353ef8e464..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AdditionalPropertiesClass - attr_accessor :map_property - - attr_accessor :map_of_map_property - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'map_property' => :'map_property', - :'map_of_map_property' => :'map_of_map_property' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'map_property' => :'Hash', - :'map_of_map_property' => :'Hash>' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesClass` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'map_property') - if (value = attributes[:'map_property']).is_a?(Hash) - self.map_property = value - end - end - - if attributes.key?(:'map_of_map_property') - if (value = attributes[:'map_of_map_property']).is_a?(Hash) - self.map_of_map_property = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - map_property == o.map_property && - map_of_map_property == o.map_of_map_property - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [map_property, map_of_map_property].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb deleted file mode 100644 index 55b0741b47f5..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Animal - attr_accessor :class_name - - attr_accessor :color - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'class_name' => :'className', - :'color' => :'color' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'class_name' => :'String', - :'color' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # discriminator's property name in OpenAPI v3 - def self.openapi_discriminator_name - :'class_name' - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Animal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'class_name') - self.class_name = attributes[:'class_name'] - end - - if attributes.key?(:'color') - self.color = attributes[:'color'] - else - self.color = 'red' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @class_name.nil? - invalid_properties.push('invalid value for "class_name", class_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @class_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - class_name == o.class_name && - color == o.color - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [class_name, color].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb deleted file mode 100644 index eb3fd03a63cb..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ApiResponse - attr_accessor :code - - attr_accessor :type - - attr_accessor :message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'type' => :'type', - :'message' => :'message' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Integer', - :'type' => :'String', - :'message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ApiResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - type == o.type && - message == o.message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, type, message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb deleted file mode 100644 index 1348124c720f..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ /dev/null @@ -1,208 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ArrayOfArrayOfNumberOnly - attr_accessor :array_array_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'array_array_number' => :'ArrayArrayNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'array_array_number' => :'Array>' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfArrayOfNumberOnly` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'array_array_number') - if (value = attributes[:'array_array_number']).is_a?(Array) - self.array_array_number = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - array_array_number == o.array_array_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [array_array_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb deleted file mode 100644 index 8ea8dff8ffaf..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ /dev/null @@ -1,208 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ArrayOfNumberOnly - attr_accessor :array_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'array_number' => :'ArrayNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'array_number' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfNumberOnly` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'array_number') - if (value = attributes[:'array_number']).is_a?(Array) - self.array_number = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - array_number == o.array_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [array_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb deleted file mode 100644 index 7f3e302da040..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ArrayTest - attr_accessor :array_of_string - - attr_accessor :array_array_of_integer - - attr_accessor :array_array_of_model - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'array_of_string' => :'array_of_string', - :'array_array_of_integer' => :'array_array_of_integer', - :'array_array_of_model' => :'array_array_of_model' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'array_of_string' => :'Array', - :'array_array_of_integer' => :'Array>', - :'array_array_of_model' => :'Array>' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayTest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'array_of_string') - if (value = attributes[:'array_of_string']).is_a?(Array) - self.array_of_string = value - end - end - - if attributes.key?(:'array_array_of_integer') - if (value = attributes[:'array_array_of_integer']).is_a?(Array) - self.array_array_of_integer = value - end - end - - if attributes.key?(:'array_array_of_model') - if (value = attributes[:'array_array_of_model']).is_a?(Array) - self.array_array_of_model = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - array_of_string == o.array_of_string && - array_array_of_integer == o.array_array_of_integer && - array_array_of_model == o.array_array_of_model - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [array_of_string, array_array_of_integer, array_array_of_model].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb deleted file mode 100644 index 6d2a185d4086..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Capitalization - attr_accessor :small_camel - - attr_accessor :capital_camel - - attr_accessor :small_snake - - attr_accessor :capital_snake - - attr_accessor :sca_eth_flow_points - - # Name of the pet - attr_accessor :att_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'small_camel' => :'smallCamel', - :'capital_camel' => :'CapitalCamel', - :'small_snake' => :'small_Snake', - :'capital_snake' => :'Capital_Snake', - :'sca_eth_flow_points' => :'SCA_ETH_Flow_Points', - :'att_name' => :'ATT_NAME' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'small_camel' => :'String', - :'capital_camel' => :'String', - :'small_snake' => :'String', - :'capital_snake' => :'String', - :'sca_eth_flow_points' => :'String', - :'att_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Capitalization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'small_camel') - self.small_camel = attributes[:'small_camel'] - end - - if attributes.key?(:'capital_camel') - self.capital_camel = attributes[:'capital_camel'] - end - - if attributes.key?(:'small_snake') - self.small_snake = attributes[:'small_snake'] - end - - if attributes.key?(:'capital_snake') - self.capital_snake = attributes[:'capital_snake'] - end - - if attributes.key?(:'sca_eth_flow_points') - self.sca_eth_flow_points = attributes[:'sca_eth_flow_points'] - end - - if attributes.key?(:'att_name') - self.att_name = attributes[:'att_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - small_camel == o.small_camel && - capital_camel == o.capital_camel && - small_snake == o.small_snake && - capital_snake == o.capital_snake && - sca_eth_flow_points == o.sca_eth_flow_points && - att_name == o.att_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [small_camel, capital_camel, small_snake, capital_snake, sca_eth_flow_points, att_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb deleted file mode 100644 index edc40a27fc3a..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Cat < Animal - attr_accessor :declawed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'declawed' => :'declawed' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'declawed' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Animal', - :'CatAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Cat` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'declawed') - self.declawed = attributes[:'declawed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true && super - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - declawed == o.declawed && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [declawed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb deleted file mode 100644 index ec0963e95123..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class CatAllOf - attr_accessor :declawed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'declawed' => :'declawed' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'declawed' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::CatAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::CatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'declawed') - self.declawed = attributes[:'declawed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - declawed == o.declawed - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [declawed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb deleted file mode 100644 index 7a2e43d80871..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Category - attr_accessor :id - - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Category` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - else - self.name = 'default-name' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb deleted file mode 100644 index c67cb4e2db8a..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb +++ /dev/null @@ -1,207 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Model for testing model with \"_class\" property - class ClassModel - attr_accessor :_class - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_class' => :'_class' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_class' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ClassModel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_class') - self._class = attributes[:'_class'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _class == o._class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_class].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb deleted file mode 100644 index fb11d2a9f046..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Client - attr_accessor :client - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client' => :'client' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'client' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Client` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client') - self.client = attributes[:'client'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client == o.client - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb deleted file mode 100644 index e463e0dcd1ec..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Dog < Animal - attr_accessor :breed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'breed' => :'breed' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'breed' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Animal', - :'DogAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Dog` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'breed') - self.breed = attributes[:'breed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true && super - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - breed == o.breed && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [breed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb deleted file mode 100644 index afaf911b6c21..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class DogAllOf - attr_accessor :breed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'breed' => :'breed' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'breed' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::DogAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DogAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'breed') - self.breed = attributes[:'breed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - breed == o.breed - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [breed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb deleted file mode 100644 index de2ea593e9e2..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class EnumArrays - attr_accessor :just_symbol - - attr_accessor :array_enum - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'just_symbol' => :'just_symbol', - :'array_enum' => :'array_enum' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'just_symbol' => :'String', - :'array_enum' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumArrays` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'just_symbol') - self.just_symbol = attributes[:'just_symbol'] - end - - if attributes.key?(:'array_enum') - if (value = attributes[:'array_enum']).is_a?(Array) - self.array_enum = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - just_symbol_validator = EnumAttributeValidator.new('String', [">=", "$"]) - return false unless just_symbol_validator.valid?(@just_symbol) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] just_symbol Object to be assigned - def just_symbol=(just_symbol) - validator = EnumAttributeValidator.new('String', [">=", "$"]) - unless validator.valid?(just_symbol) - fail ArgumentError, "invalid value for \"just_symbol\", must be one of #{validator.allowable_values}." - end - @just_symbol = just_symbol - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - just_symbol == o.just_symbol && - array_enum == o.array_enum - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [just_symbol, array_enum].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb deleted file mode 100644 index 69fcebec615b..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ /dev/null @@ -1,37 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class EnumClass - 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 self.build_from_hash(value) - new.build_from_hash(value) - end - - # 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) - constantValues = EnumClass.constants.select { |c| EnumClass::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #EnumClass" if constantValues.empty? - value - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb deleted file mode 100644 index 473d7994ad6d..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ /dev/null @@ -1,345 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class EnumTest - attr_accessor :enum_string - - attr_accessor :enum_string_required - - attr_accessor :enum_integer - - attr_accessor :enum_number - - attr_accessor :outer_enum - - attr_accessor :outer_enum_integer - - attr_accessor :outer_enum_default_value - - attr_accessor :outer_enum_integer_default_value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enum_string' => :'enum_string', - :'enum_string_required' => :'enum_string_required', - :'enum_integer' => :'enum_integer', - :'enum_number' => :'enum_number', - :'outer_enum' => :'outerEnum', - :'outer_enum_integer' => :'outerEnumInteger', - :'outer_enum_default_value' => :'outerEnumDefaultValue', - :'outer_enum_integer_default_value' => :'outerEnumIntegerDefaultValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'enum_string' => :'String', - :'enum_string_required' => :'String', - :'enum_integer' => :'Integer', - :'enum_number' => :'Float', - :'outer_enum' => :'OuterEnum', - :'outer_enum_integer' => :'OuterEnumInteger', - :'outer_enum_default_value' => :'OuterEnumDefaultValue', - :'outer_enum_integer_default_value' => :'OuterEnumIntegerDefaultValue' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'outer_enum', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumTest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enum_string') - self.enum_string = attributes[:'enum_string'] - end - - if attributes.key?(:'enum_string_required') - self.enum_string_required = attributes[:'enum_string_required'] - end - - if attributes.key?(:'enum_integer') - self.enum_integer = attributes[:'enum_integer'] - end - - if attributes.key?(:'enum_number') - self.enum_number = attributes[:'enum_number'] - end - - if attributes.key?(:'outer_enum') - self.outer_enum = attributes[:'outer_enum'] - end - - if attributes.key?(:'outer_enum_integer') - self.outer_enum_integer = attributes[:'outer_enum_integer'] - end - - if attributes.key?(:'outer_enum_default_value') - self.outer_enum_default_value = attributes[:'outer_enum_default_value'] - end - - if attributes.key?(:'outer_enum_integer_default_value') - self.outer_enum_integer_default_value = attributes[:'outer_enum_integer_default_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @enum_string_required.nil? - invalid_properties.push('invalid value for "enum_string_required", enum_string_required cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - enum_string_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - return false unless enum_string_validator.valid?(@enum_string) - return false if @enum_string_required.nil? - enum_string_required_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - return false unless enum_string_required_validator.valid?(@enum_string_required) - enum_integer_validator = EnumAttributeValidator.new('Integer', [1, -1]) - return false unless enum_integer_validator.valid?(@enum_integer) - enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) - return false unless enum_number_validator.valid?(@enum_number) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_string Object to be assigned - def enum_string=(enum_string) - validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - unless validator.valid?(enum_string) - fail ArgumentError, "invalid value for \"enum_string\", must be one of #{validator.allowable_values}." - end - @enum_string = enum_string - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_string_required Object to be assigned - def enum_string_required=(enum_string_required) - validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - unless validator.valid?(enum_string_required) - fail ArgumentError, "invalid value for \"enum_string_required\", must be one of #{validator.allowable_values}." - end - @enum_string_required = enum_string_required - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_integer Object to be assigned - def enum_integer=(enum_integer) - validator = EnumAttributeValidator.new('Integer', [1, -1]) - unless validator.valid?(enum_integer) - fail ArgumentError, "invalid value for \"enum_integer\", must be one of #{validator.allowable_values}." - end - @enum_integer = enum_integer - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_number Object to be assigned - def enum_number=(enum_number) - validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) - unless validator.valid?(enum_number) - fail ArgumentError, "invalid value for \"enum_number\", must be one of #{validator.allowable_values}." - end - @enum_number = enum_number - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enum_string == o.enum_string && - enum_string_required == o.enum_string_required && - enum_integer == o.enum_integer && - enum_number == o.enum_number && - outer_enum == o.outer_enum && - outer_enum_integer == o.outer_enum_integer && - outer_enum_default_value == o.outer_enum_default_value && - outer_enum_integer_default_value == o.outer_enum_integer_default_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enum_string, enum_string_required, enum_integer, enum_number, outer_enum, outer_enum_integer, outer_enum_default_value, outer_enum_integer_default_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb deleted file mode 100644 index ae55f5eb63e1..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb +++ /dev/null @@ -1,208 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Must be named `File` for test. - class File - # Test capitalization - attr_accessor :source_uri - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'source_uri' => :'sourceURI' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'source_uri' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::File` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'source_uri') - self.source_uri = attributes[:'source_uri'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - source_uri == o.source_uri - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [source_uri].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb deleted file mode 100644 index 8291d10e6ac5..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class FileSchemaTestClass - attr_accessor :file - - attr_accessor :files - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'file' => :'file', - :'files' => :'files' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'file' => :'File', - :'files' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FileSchemaTestClass` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'file') - self.file = attributes[:'file'] - end - - if attributes.key?(:'files') - if (value = attributes[:'files']).is_a?(Array) - self.files = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - file == o.file && - files == o.files - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [file, files].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb deleted file mode 100644 index d39e9c915806..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb +++ /dev/null @@ -1,557 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class FormatTest - attr_accessor :integer - - attr_accessor :int32 - - attr_accessor :int64 - - attr_accessor :number - - attr_accessor :float - - attr_accessor :double - - attr_accessor :string - - attr_accessor :byte - - attr_accessor :binary - - attr_accessor :date - - attr_accessor :date_time - - attr_accessor :uuid - - attr_accessor :password - - # A string that is a 10 digit number. Can have leading zeros. - attr_accessor :pattern_with_digits - - # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - attr_accessor :pattern_with_digits_and_delimiter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'integer' => :'integer', - :'int32' => :'int32', - :'int64' => :'int64', - :'number' => :'number', - :'float' => :'float', - :'double' => :'double', - :'string' => :'string', - :'byte' => :'byte', - :'binary' => :'binary', - :'date' => :'date', - :'date_time' => :'dateTime', - :'uuid' => :'uuid', - :'password' => :'password', - :'pattern_with_digits' => :'pattern_with_digits', - :'pattern_with_digits_and_delimiter' => :'pattern_with_digits_and_delimiter' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'integer' => :'Integer', - :'int32' => :'Integer', - :'int64' => :'Integer', - :'number' => :'Float', - :'float' => :'Float', - :'double' => :'Float', - :'string' => :'String', - :'byte' => :'String', - :'binary' => :'File', - :'date' => :'Date', - :'date_time' => :'DateTime', - :'uuid' => :'String', - :'password' => :'String', - :'pattern_with_digits' => :'String', - :'pattern_with_digits_and_delimiter' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FormatTest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FormatTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'integer') - self.integer = attributes[:'integer'] - end - - if attributes.key?(:'int32') - self.int32 = attributes[:'int32'] - end - - if attributes.key?(:'int64') - self.int64 = attributes[:'int64'] - end - - if attributes.key?(:'number') - self.number = attributes[:'number'] - end - - if attributes.key?(:'float') - self.float = attributes[:'float'] - end - - if attributes.key?(:'double') - self.double = attributes[:'double'] - end - - if attributes.key?(:'string') - self.string = attributes[:'string'] - end - - if attributes.key?(:'byte') - self.byte = attributes[:'byte'] - end - - if attributes.key?(:'binary') - self.binary = attributes[:'binary'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'date_time') - self.date_time = attributes[:'date_time'] - end - - if attributes.key?(:'uuid') - self.uuid = attributes[:'uuid'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'pattern_with_digits') - self.pattern_with_digits = attributes[:'pattern_with_digits'] - end - - if attributes.key?(:'pattern_with_digits_and_delimiter') - self.pattern_with_digits_and_delimiter = attributes[:'pattern_with_digits_and_delimiter'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@integer.nil? && @integer > 100 - invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') - end - - if !@integer.nil? && @integer < 10 - invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') - end - - if !@int32.nil? && @int32 > 200 - invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') - end - - if !@int32.nil? && @int32 < 20 - invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') - end - - if @number.nil? - invalid_properties.push('invalid value for "number", number cannot be nil.') - end - - if @number > 543.2 - invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') - end - - if @number < 32.1 - invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') - end - - if !@float.nil? && @float > 987.6 - invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') - end - - if !@float.nil? && @float < 54.3 - invalid_properties.push('invalid value for "float", must be greater than or equal to 54.3.') - end - - if !@double.nil? && @double > 123.4 - invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') - end - - if !@double.nil? && @double < 67.8 - invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') - end - - pattern = Regexp.new(/[a-z]/i) - if !@string.nil? && @string !~ pattern - invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") - end - - if @byte.nil? - invalid_properties.push('invalid value for "byte", byte cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @password.nil? - invalid_properties.push('invalid value for "password", password cannot be nil.') - end - - if @password.to_s.length > 64 - invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') - end - - if @password.to_s.length < 10 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') - end - - pattern = Regexp.new(/^\d{10}$/) - if !@pattern_with_digits.nil? && @pattern_with_digits !~ pattern - invalid_properties.push("invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}.") - end - - pattern = Regexp.new(/^image_\d{1,3}$/i) - if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ pattern - invalid_properties.push("invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}.") - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@integer.nil? && @integer > 100 - return false if !@integer.nil? && @integer < 10 - return false if !@int32.nil? && @int32 > 200 - return false if !@int32.nil? && @int32 < 20 - return false if @number.nil? - return false if @number > 543.2 - return false if @number < 32.1 - return false if !@float.nil? && @float > 987.6 - return false if !@float.nil? && @float < 54.3 - return false if !@double.nil? && @double > 123.4 - return false if !@double.nil? && @double < 67.8 - return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) - return false if @byte.nil? - return false if @date.nil? - return false if @password.nil? - return false if @password.to_s.length > 64 - return false if @password.to_s.length < 10 - return false if !@pattern_with_digits.nil? && @pattern_with_digits !~ Regexp.new(/^\d{10}$/) - return false if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ Regexp.new(/^image_\d{1,3}$/i) - true - end - - # Custom attribute writer method with validation - # @param [Object] integer Value to be assigned - def integer=(integer) - if !integer.nil? && integer > 100 - fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' - end - - if !integer.nil? && integer < 10 - fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' - end - - @integer = integer - end - - # Custom attribute writer method with validation - # @param [Object] int32 Value to be assigned - def int32=(int32) - if !int32.nil? && int32 > 200 - fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' - end - - if !int32.nil? && int32 < 20 - fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' - end - - @int32 = int32 - end - - # Custom attribute writer method with validation - # @param [Object] number Value to be assigned - def number=(number) - if number.nil? - fail ArgumentError, 'number cannot be nil' - end - - if number > 543.2 - fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' - end - - if number < 32.1 - fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' - end - - @number = number - end - - # Custom attribute writer method with validation - # @param [Object] float Value to be assigned - def float=(float) - if !float.nil? && float > 987.6 - fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' - end - - if !float.nil? && float < 54.3 - fail ArgumentError, 'invalid value for "float", must be greater than or equal to 54.3.' - end - - @float = float - end - - # Custom attribute writer method with validation - # @param [Object] double Value to be assigned - def double=(double) - if !double.nil? && double > 123.4 - fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' - end - - if !double.nil? && double < 67.8 - fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' - end - - @double = double - end - - # Custom attribute writer method with validation - # @param [Object] string Value to be assigned - def string=(string) - pattern = Regexp.new(/[a-z]/i) - if !string.nil? && string !~ pattern - fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." - end - - @string = string - end - - # Custom attribute writer method with validation - # @param [Object] password Value to be assigned - def password=(password) - if password.nil? - fail ArgumentError, 'password cannot be nil' - end - - if password.to_s.length > 64 - fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' - end - - if password.to_s.length < 10 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' - end - - @password = password - end - - # Custom attribute writer method with validation - # @param [Object] pattern_with_digits Value to be assigned - def pattern_with_digits=(pattern_with_digits) - pattern = Regexp.new(/^\d{10}$/) - if !pattern_with_digits.nil? && pattern_with_digits !~ pattern - fail ArgumentError, "invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}." - end - - @pattern_with_digits = pattern_with_digits - end - - # Custom attribute writer method with validation - # @param [Object] pattern_with_digits_and_delimiter Value to be assigned - def pattern_with_digits_and_delimiter=(pattern_with_digits_and_delimiter) - pattern = Regexp.new(/^image_\d{1,3}$/i) - if !pattern_with_digits_and_delimiter.nil? && pattern_with_digits_and_delimiter !~ pattern - fail ArgumentError, "invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}." - end - - @pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - integer == o.integer && - int32 == o.int32 && - int64 == o.int64 && - number == o.number && - float == o.float && - double == o.double && - string == o.string && - byte == o.byte && - binary == o.binary && - date == o.date && - date_time == o.date_time && - uuid == o.uuid && - password == o.password && - pattern_with_digits == o.pattern_with_digits && - pattern_with_digits_and_delimiter == o.pattern_with_digits_and_delimiter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb deleted file mode 100644 index cae8b3bbe70c..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class HasOnlyReadOnly - attr_accessor :bar - - attr_accessor :foo - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bar' => :'bar', - :'foo' => :'foo' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'bar' => :'String', - :'foo' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::HasOnlyReadOnly` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HasOnlyReadOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bar') - self.bar = attributes[:'bar'] - end - - if attributes.key?(:'foo') - self.foo = attributes[:'foo'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bar == o.bar && - foo == o.foo - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bar, foo].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb deleted file mode 100644 index 94873ca4d689..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class List - attr_accessor :_123_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_123_list' => :'123-list' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_123_list' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::List` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::List`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_123_list') - self._123_list = attributes[:'_123_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _123_list == o._123_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_123_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb deleted file mode 100644 index 65f0020e664c..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class MapTest - attr_accessor :map_map_of_string - - attr_accessor :map_of_enum_string - - attr_accessor :direct_map - - attr_accessor :indirect_map - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'map_map_of_string' => :'map_map_of_string', - :'map_of_enum_string' => :'map_of_enum_string', - :'direct_map' => :'direct_map', - :'indirect_map' => :'indirect_map' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'map_map_of_string' => :'Hash>', - :'map_of_enum_string' => :'Hash', - :'direct_map' => :'Hash', - :'indirect_map' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MapTest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MapTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'map_map_of_string') - if (value = attributes[:'map_map_of_string']).is_a?(Hash) - self.map_map_of_string = value - end - end - - if attributes.key?(:'map_of_enum_string') - if (value = attributes[:'map_of_enum_string']).is_a?(Hash) - self.map_of_enum_string = value - end - end - - if attributes.key?(:'direct_map') - if (value = attributes[:'direct_map']).is_a?(Hash) - self.direct_map = value - end - end - - if attributes.key?(:'indirect_map') - if (value = attributes[:'indirect_map']).is_a?(Hash) - self.indirect_map = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - map_map_of_string == o.map_map_of_string && - map_of_enum_string == o.map_of_enum_string && - direct_map == o.direct_map && - indirect_map == o.indirect_map - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [map_map_of_string, map_of_enum_string, direct_map, indirect_map].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb deleted file mode 100644 index 3c5cd7349f5f..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class MixedPropertiesAndAdditionalPropertiesClass - attr_accessor :uuid - - attr_accessor :date_time - - attr_accessor :map - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'uuid' => :'uuid', - :'date_time' => :'dateTime', - :'map' => :'map' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'uuid' => :'String', - :'date_time' => :'DateTime', - :'map' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MixedPropertiesAndAdditionalPropertiesClass` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MixedPropertiesAndAdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'uuid') - self.uuid = attributes[:'uuid'] - end - - if attributes.key?(:'date_time') - self.date_time = attributes[:'date_time'] - end - - if attributes.key?(:'map') - if (value = attributes[:'map']).is_a?(Hash) - self.map = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - uuid == o.uuid && - date_time == o.date_time && - map == o.map - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [uuid, date_time, map].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb deleted file mode 100644 index 950b8408a093..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Model for testing model name starting with number - class Model200Response - attr_accessor :name - - attr_accessor :_class - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'_class' => :'class' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Integer', - :'_class' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Model200Response` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Model200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'_class') - self._class = attributes[:'_class'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - _class == o._class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, _class].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb deleted file mode 100644 index a3b89b37c4b8..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb +++ /dev/null @@ -1,207 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Model for testing reserved words - class ModelReturn - attr_accessor :_return - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_return' => :'return' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_return' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ModelReturn` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ModelReturn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_return') - self._return = attributes[:'_return'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _return == o._return - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_return].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb deleted file mode 100644 index 6aaf40c05d5c..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - # Model for testing model name same as property name - class Name - attr_accessor :name - - attr_accessor :snake_case - - attr_accessor :property - - attr_accessor :_123_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'snake_case' => :'snake_case', - :'property' => :'property', - :'_123_number' => :'123Number' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Integer', - :'snake_case' => :'Integer', - :'property' => :'String', - :'_123_number' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Name` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Name`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'snake_case') - self.snake_case = attributes[:'snake_case'] - end - - if attributes.key?(:'property') - self.property = attributes[:'property'] - end - - if attributes.key?(:'_123_number') - self._123_number = attributes[:'_123_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - snake_case == o.snake_case && - property == o.property && - _123_number == o._123_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, snake_case, property, _123_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb deleted file mode 100644 index 2e62c4775e1b..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class NumberOnly - attr_accessor :just_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'just_number' => :'JustNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'just_number' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::NumberOnly` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'just_number') - self.just_number = attributes[:'just_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - just_number == o.just_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [just_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb deleted file mode 100644 index 5fc1828efeef..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Order - attr_accessor :id - - attr_accessor :pet_id - - attr_accessor :quantity - - attr_accessor :ship_date - - # Order Status - attr_accessor :status - - attr_accessor :complete - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'pet_id' => :'petId', - :'quantity' => :'quantity', - :'ship_date' => :'shipDate', - :'status' => :'status', - :'complete' => :'complete' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'pet_id' => :'Integer', - :'quantity' => :'Integer', - :'ship_date' => :'DateTime', - :'status' => :'String', - :'complete' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Order` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'pet_id') - self.pet_id = attributes[:'pet_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'ship_date') - self.ship_date = attributes[:'ship_date'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'complete') - self.complete = attributes[:'complete'] - else - self.complete = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - pet_id == o.pet_id && - quantity == o.quantity && - ship_date == o.ship_date && - status == o.status && - complete == o.complete - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, pet_id, quantity, ship_date, status, complete].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb deleted file mode 100644 index f8b23893297e..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class OuterComposite - attr_accessor :my_number - - attr_accessor :my_string - - attr_accessor :my_boolean - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'my_number' => :'my_number', - :'my_string' => :'my_string', - :'my_boolean' => :'my_boolean' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'my_number' => :'Float', - :'my_string' => :'String', - :'my_boolean' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::OuterComposite` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::OuterComposite`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'my_number') - self.my_number = attributes[:'my_number'] - end - - if attributes.key?(:'my_string') - self.my_string = attributes[:'my_string'] - end - - if attributes.key?(:'my_boolean') - self.my_boolean = attributes[:'my_boolean'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - my_number == o.my_number && - my_string == o.my_string && - my_boolean == o.my_boolean - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [my_number, my_string, my_boolean].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb deleted file mode 100644 index d7c1b931b973..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ /dev/null @@ -1,37 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class OuterEnum - 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 self.build_from_hash(value) - new.build_from_hash(value) - end - - # 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) - constantValues = OuterEnum.constants.select { |c| OuterEnum::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #OuterEnum" if constantValues.empty? - value - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb deleted file mode 100644 index 6c67989e4b2e..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb +++ /dev/null @@ -1,300 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Pet - attr_accessor :id - - attr_accessor :category - - attr_accessor :name - - attr_accessor :photo_urls - - attr_accessor :tags - - # pet status in the store - attr_accessor :status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'category' => :'category', - :'name' => :'name', - :'photo_urls' => :'photoUrls', - :'tags' => :'tags', - :'status' => :'status' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'category' => :'Category', - :'name' => :'String', - :'photo_urls' => :'Array', - :'tags' => :'Array', - :'status' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Pet` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'category') - self.category = attributes[:'category'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'photo_urls') - if (value = attributes[:'photo_urls']).is_a?(Array) - self.photo_urls = value - end - end - - if attributes.key?(:'tags') - if (value = attributes[:'tags']).is_a?(Array) - self.tags = value - end - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @photo_urls.nil? - invalid_properties.push('invalid value for "photo_urls", photo_urls cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @photo_urls.nil? - status_validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - category == o.category && - name == o.name && - photo_urls == o.photo_urls && - tags == o.tags && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, category, name, photo_urls, tags, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb deleted file mode 100644 index b8edc7ba8ea5..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class ReadOnlyFirst - attr_accessor :bar - - attr_accessor :baz - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bar' => :'bar', - :'baz' => :'baz' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'bar' => :'String', - :'baz' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ReadOnlyFirst` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ReadOnlyFirst`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bar') - self.bar = attributes[:'bar'] - end - - if attributes.key?(:'baz') - self.baz = attributes[:'baz'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bar == o.bar && - baz == o.baz - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bar, baz].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb deleted file mode 100644 index 5c1be0fd3bea..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class SpecialModelName - attr_accessor :special_property_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'special_property_name' => :'$special[property.name]' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'special_property_name' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialModelName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialModelName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'special_property_name') - self.special_property_name = attributes[:'special_property_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - special_property_name == o.special_property_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [special_property_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb deleted file mode 100644 index 86d8c0aa8c57..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Tag - attr_accessor :id - - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Tag` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb deleted file mode 100644 index 096f5452b0d8..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class User - attr_accessor :id - - attr_accessor :username - - attr_accessor :first_name - - attr_accessor :last_name - - attr_accessor :email - - attr_accessor :password - - attr_accessor :phone - - # User Status - attr_accessor :user_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'username' => :'username', - :'first_name' => :'firstName', - :'last_name' => :'lastName', - :'email' => :'email', - :'password' => :'password', - :'phone' => :'phone', - :'user_status' => :'userStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Integer', - :'username' => :'String', - :'first_name' => :'String', - :'last_name' => :'String', - :'email' => :'String', - :'password' => :'String', - :'phone' => :'String', - :'user_status' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::User` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'user_status') - self.user_status = attributes[:'user_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - username == o.username && - first_name == o.first_name && - last_name == o.last_name && - email == o.email && - password == o.password && - phone == o.phone && - user_status == o.user_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, username, first_name, last_name, email, password, phone, user_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb deleted file mode 100644 index fba2068c04db..000000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb +++ /dev/null @@ -1,15 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -module Petstore - VERSION = '1.0.0' -end diff --git a/samples/openapi3/client/petstore/ruby/petstore.gemspec b/samples/openapi3/client/petstore/ruby/petstore.gemspec deleted file mode 100644 index d563bfe8e68a..000000000000 --- a/samples/openapi3/client/petstore/ruby/petstore.gemspec +++ /dev/null @@ -1,39 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -$:.push File.expand_path("../lib", __FILE__) -require "petstore/version" - -Gem::Specification.new do |s| - s.name = "petstore" - s.version = Petstore::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["OpenAPI-Generator"] - s.email = [""] - s.homepage = "https://openapi-generator.tech" - s.summary = "OpenAPI 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" - s.required_ruby_version = ">= 1.9" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb deleted file mode 100644 index bf187f0971fe..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::AnotherFakeApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AnotherFakeApi' do - before do - # run before each test - @api_instance = Petstore::AnotherFakeApi.new - end - - after do - # run after each test - end - - describe 'test an instance of AnotherFakeApi' do - it 'should create an instance of AnotherFakeApi' do - expect(@api_instance).to be_instance_of(Petstore::AnotherFakeApi) - end - end - - # unit tests for call_123_test_special_tags - # To test special tags - # To test special tags and operation ID starting with number - # @param client client model - # @param [Hash] opts the optional parameters - # @return [Client] - describe 'call_123_test_special_tags test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb deleted file mode 100644 index 7374568eaf0d..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::FakeApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'FakeApi' do - before do - # run before each test - @api_instance = Petstore::FakeApi.new - end - - after do - # run after each test - end - - describe 'test an instance of FakeApi' do - it 'should create an instance of FakeApi' do - expect(@api_instance).to be_instance_of(Petstore::FakeApi) - end - end - - # unit tests for fake_health_get - # Health check endpoint - # @param [Hash] opts the optional parameters - # @return [HealthCheckResult] - describe 'fake_health_get test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_http_signature_test - # test http signature authentication - # @param pet Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @option opts [String] :query_1 query parameter - # @option opts [String] :header_1 header parameter - # @return [nil] - describe 'fake_http_signature_test test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_outer_boolean_serialize - # Test serialization of outer boolean types - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :body Input boolean as post body - # @return [Boolean] - describe 'fake_outer_boolean_serialize test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_outer_composite_serialize - # Test serialization of object with outer number type - # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body - # @return [OuterComposite] - describe 'fake_outer_composite_serialize test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_outer_number_serialize - # Test serialization of outer number types - # @param [Hash] opts the optional parameters - # @option opts [Float] :body Input number as post body - # @return [Float] - describe 'fake_outer_number_serialize test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for fake_outer_string_serialize - # Test serialization of outer string types - # @param [Hash] opts the optional parameters - # @option opts [String] :body Input string as post body - # @return [String] - describe 'fake_outer_string_serialize test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_body_with_file_schema - # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_body_with_file_schema test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_body_with_query_params - # @param query - # @param user - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_body_with_query_params test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_client_model - # To test \"client\" model - # To test \"client\" model - # @param client client model - # @param [Hash] opts the optional parameters - # @return [Client] - describe 'test_client_model test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_endpoint_parameters - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # @param number None - # @param double None - # @param pattern_without_delimiter None - # @param byte None - # @param [Hash] opts the optional parameters - # @option opts [Integer] :integer None - # @option opts [Integer] :int32 None - # @option opts [Integer] :int64 None - # @option opts [Float] :float None - # @option opts [String] :string None - # @option opts [File] :binary None - # @option opts [Date] :date None - # @option opts [DateTime] :date_time None - # @option opts [String] :password None - # @option opts [String] :callback None - # @return [nil] - describe 'test_endpoint_parameters test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_enum_parameters - # To test enum parameters - # 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) - # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) - # @option opts [String] :enum_query_string Query parameter enum test (string) - # @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) - # @return [nil] - describe 'test_enum_parameters test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_group_parameters - # Fake endpoint to test group parameters (optional) - # Fake endpoint to test group parameters (optional) - # @param required_string_group Required String in group parameters - # @param required_boolean_group Required Boolean in group parameters - # @param required_int64_group Required Integer in group parameters - # @param [Hash] opts the optional parameters - # @option opts [Integer] :string_group String in group parameters - # @option opts [Boolean] :boolean_group Boolean in group parameters - # @option opts [Integer] :int64_group Integer in group parameters - # @return [nil] - describe 'test_group_parameters test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_inline_additional_properties - # test inline additionalProperties - # @param request_body request body - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_inline_additional_properties test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_json_form_data - # test json serialization of form data - # @param param field1 - # @param param2 field2 - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_json_form_data test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for test_query_parameter_collection_format - # To test the collection format in query parameters - # @param pipe - # @param ioutil - # @param http - # @param url - # @param context - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'test_query_parameter_collection_format test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb deleted file mode 100644 index 1db2b3c9ef52..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::FakeClassnameTags123Api -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'FakeClassnameTags123Api' do - before do - # run before each test - @api_instance = Petstore::FakeClassnameTags123Api.new - end - - after do - # run after each test - end - - describe 'test an instance of FakeClassnameTags123Api' do - it 'should create an instance of FakeClassnameTags123Api' do - expect(@api_instance).to be_instance_of(Petstore::FakeClassnameTags123Api) - end - end - - # unit tests for test_classname - # To test class name in snake case - # To test class name in snake case - # @param client client model - # @param [Hash] opts the optional parameters - # @return [Client] - describe 'test_classname test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb deleted file mode 100644 index 26ca32b2f754..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb +++ /dev/null @@ -1,144 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::PetApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'PetApi' do - before do - # run before each test - @api_instance = Petstore::PetApi.new - end - - after do - # run after each test - end - - describe 'test an instance of PetApi' do - it 'should create an instance of PetApi' do - expect(@api_instance).to be_instance_of(Petstore::PetApi) - end - end - - # unit tests for add_pet - # Add a new pet to the store - # @param pet Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'add_pet test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for delete_pet - # Deletes a pet - # @param pet_id Pet id to delete - # @param [Hash] opts the optional parameters - # @option opts [String] :api_key - # @return [nil] - describe 'delete_pet test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for find_pets_by_status - # Finds Pets by status - # Multiple status values can be provided with comma separated strings - # @param status Status values that need to be considered for filter - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'find_pets_by_status test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for find_pets_by_tags - # Finds Pets by tags - # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - # @param tags Tags to filter by - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'find_pets_by_tags test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_pet_by_id - # Find pet by ID - # Returns a single pet - # @param pet_id ID of pet to return - # @param [Hash] opts the optional parameters - # @return [Pet] - describe 'get_pet_by_id test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for update_pet - # Update an existing pet - # @param pet Pet object that needs to be added to the store - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_pet test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for update_pet_with_form - # Updates a pet in the store with form data - # @param pet_id ID of pet that needs to be updated - # @param [Hash] opts the optional parameters - # @option opts [String] :name Updated name of the pet - # @option opts [String] :status Updated status of the pet - # @return [nil] - describe 'update_pet_with_form test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for upload_file - # uploads an image - # @param pet_id ID of pet to update - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @option opts [File] :file file to upload - # @return [ApiResponse] - describe 'upload_file test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for upload_file_with_required_file - # uploads an image (required) - # @param pet_id ID of pet to update - # @param required_file file to upload - # @param [Hash] opts the optional parameters - # @option opts [String] :additional_metadata Additional data to pass to server - # @return [ApiResponse] - describe 'upload_file_with_required_file test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb deleted file mode 100644 index 1fd9faf40aaf..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb +++ /dev/null @@ -1,81 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::StoreApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'StoreApi' do - before do - # run before each test - @api_instance = Petstore::StoreApi.new - end - - after do - # run after each test - end - - describe 'test an instance of StoreApi' do - it 'should create an instance of StoreApi' do - expect(@api_instance).to be_instance_of(Petstore::StoreApi) - end - end - - # unit tests for delete_order - # Delete purchase order by ID - # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - # @param order_id ID of the order that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_order test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_inventory - # Returns pet inventories by status - # Returns a map of status codes to quantities - # @param [Hash] opts the optional parameters - # @return [Hash] - describe 'get_inventory test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_order_by_id - # Find purchase order by ID - # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - # @param order_id ID of pet that needs to be fetched - # @param [Hash] opts the optional parameters - # @return [Order] - describe 'get_order_by_id test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for place_order - # Place an order for a pet - # @param order order placed for purchasing the pet - # @param [Hash] opts the optional parameters - # @return [Order] - describe 'place_order test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb deleted file mode 100644 index 39178c5a5ac7..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb +++ /dev/null @@ -1,127 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::UserApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'UserApi' do - before do - # run before each test - @api_instance = Petstore::UserApi.new - end - - after do - # run after each test - end - - describe 'test an instance of UserApi' do - it 'should create an instance of UserApi' do - expect(@api_instance).to be_instance_of(Petstore::UserApi) - end - end - - # unit tests for create_user - # Create user - # This can only be done by the logged in user. - # @param user Created user object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'create_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for create_users_with_array_input - # Creates list of users with given input array - # @param user List of user object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'create_users_with_array_input test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for create_users_with_list_input - # Creates list of users with given input array - # @param user List of user object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'create_users_with_list_input test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for delete_user - # Delete user - # This can only be done by the logged in user. - # @param username The name that needs to be deleted - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_user_by_name - # Get user by user name - # @param username The name that needs to be fetched. Use user1 for testing. - # @param [Hash] opts the optional parameters - # @return [User] - describe 'get_user_by_name test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for login_user - # Logs user into the system - # @param username The user name for login - # @param password The password for login in clear text - # @param [Hash] opts the optional parameters - # @return [String] - describe 'login_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for logout_user - # Logs out current logged in user session - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'logout_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for update_user - # Updated user - # This can only be done by the logged in user. - # @param username name that need to be deleted - # @param user Updated user object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_user test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb deleted file mode 100644 index 4000277862d1..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' - -describe Petstore::ApiClient do - context 'initialization' do - context 'URL stuff' do - context 'host' do - it 'removes http from host' do - Petstore.configure { |c| c.host = 'http://example.com' } - expect(Petstore::Configuration.default.host).to eq('example.com') - end - - it 'removes https from host' do - Petstore.configure { |c| c.host = 'https://wookiee.com' } - expect(Petstore::ApiClient.default.config.host).to eq('wookiee.com') - end - - it 'removes trailing path from host' do - Petstore.configure { |c| c.host = 'hobo.com/v4' } - expect(Petstore::Configuration.default.host).to eq('hobo.com') - end - end - - context 'base_path' do - it "prepends a slash to base_path" do - Petstore.configure { |c| c.base_path = 'v4/dog' } - expect(Petstore::Configuration.default.base_path).to eq('/v4/dog') - end - - it "doesn't prepend a slash if one is already there" do - Petstore.configure { |c| c.base_path = '/v4/dog' } - expect(Petstore::Configuration.default.base_path).to eq('/v4/dog') - end - - it "ends up as a blank string if nil" do - Petstore.configure { |c| c.base_path = nil } - expect(Petstore::Configuration.default.base_path).to eq('') - end - end - end - end - - describe 'params_encoding in #build_request' do - let(:config) { Petstore::Configuration.new } - let(:api_client) { Petstore::ApiClient.new(config) } - - it 'defaults to nil' do - expect(Petstore::Configuration.default.params_encoding).to eq(nil) - expect(config.params_encoding).to eq(nil) - - request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(nil) - end - - it 'can be customized' do - config.params_encoding = :multi - request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(:multi) - end - end - - describe 'timeout in #build_request' do - let(:config) { Petstore::Configuration.new } - let(:api_client) { Petstore::ApiClient.new(config) } - - it 'defaults to 0' do - expect(Petstore::Configuration.default.timeout).to eq(0) - expect(config.timeout).to eq(0) - - request = api_client.build_request(:get, '/test') - expect(request.options[:timeout]).to eq(0) - end - - it 'can be customized' do - config.timeout = 100 - request = api_client.build_request(:get, '/test') - expect(request.options[:timeout]).to eq(100) - end - end - - describe '#deserialize' do - it "handles Array" do - api_client = Petstore::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[12, 34]') - data = api_client.deserialize(response, 'Array') - expect(data).to be_instance_of(Array) - expect(data).to eq([12, 34]) - end - - it 'handles Array>' do - api_client = Petstore::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[[12, 34], [56]]') - data = api_client.deserialize(response, 'Array>') - expect(data).to be_instance_of(Array) - expect(data).to eq([[12, 34], [56]]) - end - - it 'handles Hash' do - api_client = Petstore::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '{"message": "Hello"}') - data = api_client.deserialize(response, 'Hash') - expect(data).to be_instance_of(Hash) - expect(data).to eq(:message => 'Hello') - end - end - - describe "#object_to_hash" do - it 'ignores nils and includes empty arrays' do - # uncomment below to test object_to_hash for model - # api_client = Petstore::ApiClient.new - # _model = Petstore::ModelName.new - # update the model attribute below - # _model.id = 1 - # update the expected value (hash) below - # expected = {id: 1, name: '', tags: []} - # expect(api_client.object_to_hash(_model)).to eq(expected) - end - end - - describe '#build_collection_param' do - let(:param) { ['aa', 'bb', 'cc'] } - let(:api_client) { Petstore::ApiClient.new } - - it 'works for csv' do - expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') - end - - it 'works for ssv' do - expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') - end - - it 'works for tsv' do - expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") - end - - it 'works for pipes' do - expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') - end - - it 'works for multi' do - expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) - end - - it 'fails for invalid collection format' do - expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') - end - end - - describe '#json_mime?' do - let(:api_client) { Petstore::ApiClient.new } - - it 'works' do - expect(api_client.json_mime?(nil)).to eq false - expect(api_client.json_mime?('')).to eq false - - expect(api_client.json_mime?('application/json')).to eq true - expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true - expect(api_client.json_mime?('APPLICATION/JSON')).to eq true - - expect(api_client.json_mime?('application/xml')).to eq false - expect(api_client.json_mime?('text/plain')).to eq false - expect(api_client.json_mime?('application/jsonp')).to eq false - end - end - - describe '#select_header_accept' do - let(:api_client) { Petstore::ApiClient.new } - - it 'works' do - expect(api_client.select_header_accept(nil)).to be_nil - expect(api_client.select_header_accept([])).to be_nil - - expect(api_client.select_header_accept(['application/json'])).to eq('application/json') - expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - - expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') - end - end - - describe '#select_header_content_type' do - let(:api_client) { Petstore::ApiClient.new } - - it 'works' do - expect(api_client.select_header_content_type(nil)).to eq('application/json') - expect(api_client.select_header_content_type([])).to eq('application/json') - - expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') - expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') - end - end - - describe '#sanitize_filename' do - let(:api_client) { Petstore::ApiClient.new } - - it 'works' do - expect(api_client.sanitize_filename('sun')).to eq('sun') - expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb deleted file mode 100644 index 0bea24033c64..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' - -describe Petstore::Configuration do - let(:config) { Petstore::Configuration.default } - - before(:each) do - # uncomment below to setup host and base_path - # require 'URI' - # uri = URI.parse("http://petstore.swagger.io:80/v2") - # Petstore.configure do |c| - # c.host = uri.host - # c.base_path = uri.path - # end - end - - describe '#base_url' do - it 'should have the default value' do - # uncomment below to test default value of the base path - # expect(config.base_url).to eq("http://petstore.swagger.io:80/v2") - end - - it 'should remove trailing slashes' do - [nil, '', '/', '//'].each do |base_path| - config.base_path = base_path - # uncomment below to test trailing slashes - # expect(config.base_url).to eq("http://petstore.swagger.io:80/v2") - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb deleted file mode 100644 index 93a5b0d5fb46..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AdditionalPropertiesClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AdditionalPropertiesClass' do - before do - # run before each test - @instance = Petstore::AdditionalPropertiesClass.new - end - - after do - # run after each test - end - - describe 'test an instance of AdditionalPropertiesClass' do - it 'should create an instance of AdditionalPropertiesClass' do - expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass) - end - end - describe 'test attribute "map_property"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_of_map_property"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb deleted file mode 100644 index 8b3e9adc5378..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Animal -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Animal' do - before do - # run before each test - @instance = Petstore::Animal.new - end - - after do - # run after each test - end - - describe 'test an instance of Animal' do - it 'should create an instance of Animal' do - expect(@instance).to be_instance_of(Petstore::Animal) - end - end - describe 'test attribute "class_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "color"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb deleted file mode 100644 index 628f1c4d7c17..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ApiResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ApiResponse' do - before do - # run before each test - @instance = Petstore::ApiResponse.new - end - - after do - # run after each test - end - - describe 'test an instance of ApiResponse' do - it 'should create an instance of ApiResponse' do - expect(@instance).to be_instance_of(Petstore::ApiResponse) - end - end - describe 'test attribute "code"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb deleted file mode 100644 index ea41c9a4b380..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ArrayOfArrayOfNumberOnly -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ArrayOfArrayOfNumberOnly' do - before do - # run before each test - @instance = Petstore::ArrayOfArrayOfNumberOnly.new - end - - after do - # run after each test - end - - describe 'test an instance of ArrayOfArrayOfNumberOnly' do - it 'should create an instance of ArrayOfArrayOfNumberOnly' do - expect(@instance).to be_instance_of(Petstore::ArrayOfArrayOfNumberOnly) - end - end - describe 'test attribute "array_array_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb deleted file mode 100644 index ba90932a7976..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ArrayOfNumberOnly -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ArrayOfNumberOnly' do - before do - # run before each test - @instance = Petstore::ArrayOfNumberOnly.new - end - - after do - # run after each test - end - - describe 'test an instance of ArrayOfNumberOnly' do - it 'should create an instance of ArrayOfNumberOnly' do - expect(@instance).to be_instance_of(Petstore::ArrayOfNumberOnly) - end - end - describe 'test attribute "array_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb deleted file mode 100644 index 6ff7397ad43c..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ArrayTest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ArrayTest' do - before do - # run before each test - @instance = Petstore::ArrayTest.new - end - - after do - # run after each test - end - - describe 'test an instance of ArrayTest' do - it 'should create an instance of ArrayTest' do - expect(@instance).to be_instance_of(Petstore::ArrayTest) - end - end - describe 'test attribute "array_of_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "array_array_of_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "array_array_of_model"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb deleted file mode 100644 index 451c59af970f..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Capitalization -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Capitalization' do - before do - # run before each test - @instance = Petstore::Capitalization.new - end - - after do - # run after each test - end - - describe 'test an instance of Capitalization' do - it 'should create an instance of Capitalization' do - expect(@instance).to be_instance_of(Petstore::Capitalization) - end - end - describe 'test attribute "small_camel"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "capital_camel"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "small_snake"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "capital_snake"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "sca_eth_flow_points"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "att_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb deleted file mode 100644 index 926ce8a2a37e..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::CatAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'CatAllOf' do - before do - # run before each test - @instance = Petstore::CatAllOf.new - end - - after do - # run after each test - end - - describe 'test an instance of CatAllOf' do - it 'should create an instance of CatAllOf' do - expect(@instance).to be_instance_of(Petstore::CatAllOf) - end - end - describe 'test attribute "declawed"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb deleted file mode 100644 index 3efb677ce64f..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Cat -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Cat' do - before do - # run before each test - @instance = Petstore::Cat.new - end - - after do - # run after each test - end - - describe 'test an instance of Cat' do - it 'should create an instance of Cat' do - expect(@instance).to be_instance_of(Petstore::Cat) - end - end - describe 'test attribute "declawed"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb deleted file mode 100644 index 82ecd78d9666..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Category -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Category' do - before do - # run before each test - @instance = Petstore::Category.new - end - - after do - # run after each test - end - - describe 'test an instance of Category' do - it 'should create an instance of Category' do - expect(@instance).to be_instance_of(Petstore::Category) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb deleted file mode 100644 index 761e89331276..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ClassModel -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ClassModel' do - before do - # run before each test - @instance = Petstore::ClassModel.new - end - - after do - # run after each test - end - - describe 'test an instance of ClassModel' do - it 'should create an instance of ClassModel' do - expect(@instance).to be_instance_of(Petstore::ClassModel) - end - end - describe 'test attribute "_class"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb deleted file mode 100644 index 4bf1ce0622b1..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Client -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Client' do - before do - # run before each test - @instance = Petstore::Client.new - end - - after do - # run after each test - end - - describe 'test an instance of Client' do - it 'should create an instance of Client' do - expect(@instance).to be_instance_of(Petstore::Client) - end - end - describe 'test attribute "client"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb deleted file mode 100644 index 5596927d4235..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::DogAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'DogAllOf' do - before do - # run before each test - @instance = Petstore::DogAllOf.new - end - - after do - # run after each test - end - - describe 'test an instance of DogAllOf' do - it 'should create an instance of DogAllOf' do - expect(@instance).to be_instance_of(Petstore::DogAllOf) - end - end - describe 'test attribute "breed"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb deleted file mode 100644 index b82df3e9d72d..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Dog -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Dog' do - before do - # run before each test - @instance = Petstore::Dog.new - end - - after do - # run after each test - end - - describe 'test an instance of Dog' do - it 'should create an instance of Dog' do - expect(@instance).to be_instance_of(Petstore::Dog) - end - end - describe 'test attribute "breed"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb deleted file mode 100644 index ac75c92581db..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::EnumArrays -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'EnumArrays' do - before do - # run before each test - @instance = Petstore::EnumArrays.new - end - - after do - # run after each test - end - - describe 'test an instance of EnumArrays' do - it 'should create an instance of EnumArrays' do - expect(@instance).to be_instance_of(Petstore::EnumArrays) - end - end - describe 'test attribute "just_symbol"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', [">=", "$"]) - # validator.allowable_values.each do |value| - # expect { @instance.just_symbol = value }.not_to raise_error - # end - end - end - - describe 'test attribute "array_enum"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["fish", "crab"]) - # validator.allowable_values.each do |value| - # expect { @instance.array_enum = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb deleted file mode 100644 index 29fcd05aa750..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::EnumClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'EnumClass' do - before do - # run before each test - @instance = Petstore::EnumClass.new - end - - after do - # run after each test - end - - describe 'test an instance of EnumClass' do - it 'should create an instance of EnumClass' do - expect(@instance).to be_instance_of(Petstore::EnumClass) - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb deleted file mode 100644 index 7f4c9c97e871..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb +++ /dev/null @@ -1,99 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::EnumTest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'EnumTest' do - before do - # run before each test - @instance = Petstore::EnumTest.new - end - - after do - # run after each test - end - - describe 'test an instance of EnumTest' do - it 'should create an instance of EnumTest' do - expect(@instance).to be_instance_of(Petstore::EnumTest) - end - end - describe 'test attribute "enum_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_string = value }.not_to raise_error - # end - end - end - - describe 'test attribute "enum_string_required"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_string_required = value }.not_to raise_error - # end - end - end - - describe 'test attribute "enum_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [1, -1]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_integer = value }.not_to raise_error - # end - end - end - - describe 'test attribute "enum_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', [1.1, -1.2]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_number = value }.not_to raise_error - # end - end - end - - describe 'test attribute "outer_enum"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "outer_enum_integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "outer_enum_default_value"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "outer_enum_integer_default_value"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb deleted file mode 100644 index 8a8d92658c97..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::FileSchemaTestClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'FileSchemaTestClass' do - before do - # run before each test - @instance = Petstore::FileSchemaTestClass.new - end - - after do - # run after each test - end - - describe 'test an instance of FileSchemaTestClass' do - it 'should create an instance of FileSchemaTestClass' do - expect(@instance).to be_instance_of(Petstore::FileSchemaTestClass) - end - end - describe 'test attribute "file"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "files"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb deleted file mode 100644 index b9d1499766ee..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::File -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'File' do - before do - # run before each test - @instance = Petstore::File.new - end - - after do - # run after each test - end - - describe 'test an instance of File' do - it 'should create an instance of File' do - expect(@instance).to be_instance_of(Petstore::File) - end - end - describe 'test attribute "source_uri"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb deleted file mode 100644 index 72fe239f298e..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb +++ /dev/null @@ -1,125 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::FormatTest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'FormatTest' do - before do - # run before each test - @instance = Petstore::FormatTest.new - end - - after do - # run after each test - end - - describe 'test an instance of FormatTest' do - it 'should create an instance of FormatTest' do - expect(@instance).to be_instance_of(Petstore::FormatTest) - end - end - describe 'test attribute "integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "int32"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "int64"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "float"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "double"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "byte"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "binary"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date_time"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "uuid"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "pattern_with_digits"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "pattern_with_digits_and_delimiter"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb deleted file mode 100644 index 9efa03a22fe0..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::HasOnlyReadOnly -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'HasOnlyReadOnly' do - before do - # run before each test - @instance = Petstore::HasOnlyReadOnly.new - end - - after do - # run after each test - end - - describe 'test an instance of HasOnlyReadOnly' do - it 'should create an instance of HasOnlyReadOnly' do - expect(@instance).to be_instance_of(Petstore::HasOnlyReadOnly) - end - end - describe 'test attribute "bar"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "foo"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb deleted file mode 100644 index db397aa108fa..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::List -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'List' do - before do - # run before each test - @instance = Petstore::List.new - end - - after do - # run after each test - end - - describe 'test an instance of List' do - it 'should create an instance of List' do - expect(@instance).to be_instance_of(Petstore::List) - end - end - describe 'test attribute "_123_list"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb deleted file mode 100644 index f7ff6788b095..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb +++ /dev/null @@ -1,63 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::MapTest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'MapTest' do - before do - # run before each test - @instance = Petstore::MapTest.new - end - - after do - # run after each test - end - - describe 'test an instance of MapTest' do - it 'should create an instance of MapTest' do - expect(@instance).to be_instance_of(Petstore::MapTest) - end - end - describe 'test attribute "map_map_of_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map_of_enum_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Hash', ["UPPER", "lower"]) - # validator.allowable_values.each do |value| - # expect { @instance.map_of_enum_string = value }.not_to raise_error - # end - end - end - - describe 'test attribute "direct_map"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "indirect_map"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb deleted file mode 100644 index 0e88f4725244..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::MixedPropertiesAndAdditionalPropertiesClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'MixedPropertiesAndAdditionalPropertiesClass' do - before do - # run before each test - @instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new - end - - after do - # run after each test - end - - describe 'test an instance of MixedPropertiesAndAdditionalPropertiesClass' do - it 'should create an instance of MixedPropertiesAndAdditionalPropertiesClass' do - expect(@instance).to be_instance_of(Petstore::MixedPropertiesAndAdditionalPropertiesClass) - end - end - describe 'test attribute "uuid"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date_time"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "map"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb deleted file mode 100644 index 133f6b94c145..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Model200Response -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Model200Response' do - before do - # run before each test - @instance = Petstore::Model200Response.new - end - - after do - # run after each test - end - - describe 'test an instance of Model200Response' do - it 'should create an instance of Model200Response' do - expect(@instance).to be_instance_of(Petstore::Model200Response) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "_class"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb deleted file mode 100644 index 57d400eb1169..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ModelReturn -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ModelReturn' do - before do - # run before each test - @instance = Petstore::ModelReturn.new - end - - after do - # run after each test - end - - describe 'test an instance of ModelReturn' do - it 'should create an instance of ModelReturn' do - expect(@instance).to be_instance_of(Petstore::ModelReturn) - end - end - describe 'test attribute "_return"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb deleted file mode 100644 index c882db4f2215..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Name -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Name' do - before do - # run before each test - @instance = Petstore::Name.new - end - - after do - # run after each test - end - - describe 'test an instance of Name' do - it 'should create an instance of Name' do - expect(@instance).to be_instance_of(Petstore::Name) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "snake_case"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "property"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "_123_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb deleted file mode 100644 index 0963591fcc12..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::NumberOnly -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'NumberOnly' do - before do - # run before each test - @instance = Petstore::NumberOnly.new - end - - after do - # run after each test - end - - describe 'test an instance of NumberOnly' do - it 'should create an instance of NumberOnly' do - expect(@instance).to be_instance_of(Petstore::NumberOnly) - end - end - describe 'test attribute "just_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb deleted file mode 100644 index 3f1d973b2751..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Order -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Order' do - before do - # run before each test - @instance = Petstore::Order.new - end - - after do - # run after each test - end - - describe 'test an instance of Order' do - it 'should create an instance of Order' do - expect(@instance).to be_instance_of(Petstore::Order) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "pet_id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "quantity"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "ship_date"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) - # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error - # end - end - end - - describe 'test attribute "complete"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb deleted file mode 100644 index bb36f4889592..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::OuterComposite -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'OuterComposite' do - before do - # run before each test - @instance = Petstore::OuterComposite.new - end - - after do - # run after each test - end - - describe 'test an instance of OuterComposite' do - it 'should create an instance of OuterComposite' do - expect(@instance).to be_instance_of(Petstore::OuterComposite) - end - end - describe 'test attribute "my_number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "my_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "my_boolean"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb deleted file mode 100644 index ea9762da93bf..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::OuterEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'OuterEnum' do - before do - # run before each test - @instance = Petstore::OuterEnum.new - end - - after do - # run after each test - end - - describe 'test an instance of OuterEnum' do - it 'should create an instance of OuterEnum' do - expect(@instance).to be_instance_of(Petstore::OuterEnum) - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb deleted file mode 100644 index dc0a0898c9ff..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Pet -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Pet' do - before do - # run before each test - @instance = Petstore::Pet.new - end - - after do - # run after each test - end - - describe 'test an instance of Pet' do - it 'should create an instance of Pet' do - expect(@instance).to be_instance_of(Petstore::Pet) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "category"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "photo_urls"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "tags"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["available", "pending", "sold"]) - # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb deleted file mode 100644 index 8d60e4433132..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::ReadOnlyFirst -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ReadOnlyFirst' do - before do - # run before each test - @instance = Petstore::ReadOnlyFirst.new - end - - after do - # run after each test - end - - describe 'test an instance of ReadOnlyFirst' do - it 'should create an instance of ReadOnlyFirst' do - expect(@instance).to be_instance_of(Petstore::ReadOnlyFirst) - end - end - describe 'test attribute "bar"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "baz"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb deleted file mode 100644 index b548f7f0951d..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::SpecialModelName -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'SpecialModelName' do - before do - # run before each test - @instance = Petstore::SpecialModelName.new - end - - after do - # run after each test - end - - describe 'test an instance of SpecialModelName' do - it 'should create an instance of SpecialModelName' do - expect(@instance).to be_instance_of(Petstore::SpecialModelName) - end - end - describe 'test attribute "special_property_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb deleted file mode 100644 index 3a7454390401..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::Tag -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'Tag' do - before do - # run before each test - @instance = Petstore::Tag.new - end - - after do - # run after each test - end - - describe 'test an instance of Tag' do - it 'should create an instance of Tag' do - expect(@instance).to be_instance_of(Petstore::Tag) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb deleted file mode 100644 index 2eb31e993a09..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb +++ /dev/null @@ -1,83 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::User -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'User' do - before do - # run before each test - @instance = Petstore::User.new - end - - after do - # run after each test - end - - describe 'test an instance of User' do - it 'should create an instance of User' do - expect(@instance).to be_instance_of(Petstore::User) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "first_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "last_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "email"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "phone"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "user_status"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb deleted file mode 100644 index 64dcf6b8f471..000000000000 --- a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb +++ /dev/null @@ -1,111 +0,0 @@ -=begin -#OpenAPI 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: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -# load the gem -require 'petstore' - -# The following was generated by the `rspec --init` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# The `.rspec` file also contains a few flags that are not defaults but that -# users commonly want. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true - end - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # These two settings work together to allow you to limit a spec run - # to individual examples or groups you care about by tagging them with - # `:focus` metadata. When nothing is tagged with `:focus`, all examples - # get run. - config.filter_run :focus - config.run_all_when_everything_filtered = true - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # This setting enables warnings. It's recommended, but in some cases may - # be too noisy due to issues in dependencies. - config.warnings = true - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = 'doc' - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end -end