migrate ruby samples to oas3 (#6414)

This commit is contained in:
William Cheng 2020-05-25 23:02:30 +08:00 committed by GitHub
parent f4897ea4a4
commit db4c4917e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
572 changed files with 1442 additions and 45622 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,6 +0,0 @@
{
"gemName": "petstore",
"moduleName": "Petstore",
"library": "faraday",
"gemVersion": "1.0.0"
}

View File

@ -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

View File

@ -22,11 +22,22 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ] if [ ! -f "$executable" ]
then then
mvn -B clean package mvn clean package
fi 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. # 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" 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-faraday.json -o samples/client/petstore/ruby-faraday $@" 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 java $JAVA_OPTS -jar $executable $ags

View File

@ -22,16 +22,22 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ] if [ ! -f "$executable" ]
then then
mvn -B clean package mvn clean package
fi 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/lib
rm -Rf samples/client/petstore/ruby/docs 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. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" 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 java $JAVA_OPTS -jar $executable $ags

View File

@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ] if [ ! -f "$executable" ]
then then
mvn -B clean package mvn clean package
fi fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" 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 java $JAVA_OPTS -jar $executable $ags

View File

@ -2,6 +2,5 @@
"gemName": "petstore", "gemName": "petstore",
"moduleName": "Petstore", "moduleName": "Petstore",
"library": "faraday", "library": "faraday",
"gemVersion": "1.0.0", "gemVersion": "1.0.0"
"strictSpecBehavior": false
} }

View File

@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ] if [ ! -f "$executable" ]
then then
mvn -B clean package mvn clean package
fi fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" 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 java $JAVA_OPTS -jar $executable $ags

View File

@ -24,8 +24,6 @@ sleep 5
declare -a samples=( declare -a samples=(
"${root}/bin/ruby-client-petstore.sh" "${root}/bin/ruby-client-petstore.sh"
"${root}/bin/ruby-client-petstore-faraday.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-petstore-all.sh"
"${root}/bin/java-jaxrs-petstore-server-all.sh" "${root}/bin/java-jaxrs-petstore-server-all.sh"
"${root}/bin/java-msf4j-petstore-server.sh" "${root}/bin/java-msf4j-petstore-server.sh"

View File

@ -1087,7 +1087,6 @@
<module>samples/client/petstore/python</module> <module>samples/client/petstore/python</module>
</modules> </modules>
</profile> </profile>
<!--
<profile> <profile>
<id>ruby-client</id> <id>ruby-client</id>
<activation> <activation>
@ -1100,7 +1099,6 @@
<module>samples/client/petstore/ruby</module> <module>samples/client/petstore/ruby</module>
</modules> </modules>
</profile> </profile>
-->
<profile> <profile>
<id>go-client</id> <id>go-client</id>
<activation> <activation>
@ -1387,7 +1385,7 @@
<module>samples/server/petstore/go-api-server</module> <module>samples/server/petstore/go-api-server</module>
<module>samples/server/petstore/go-gin-api-server</module> <module>samples/server/petstore/go-gin-api-server</module>
<!-- clients --> <!-- clients -->
<module>samples/openapi3/client/petstore/ruby</module> <module>samples/client/petstore/ruby</module>
<!-- test java-related projects --> <!-- test java-related projects -->
<module>samples/openapi3/client/petstore/scala-akka</module> <module>samples/openapi3/client/petstore/scala-akka</module>
<module>samples/client/petstore/dart2/petstore</module> <module>samples/client/petstore/dart2/petstore</module>

View File

@ -5,28 +5,20 @@
Gemfile Gemfile
README.md README.md
Rakefile Rakefile
docs/AdditionalPropertiesAnyType.md
docs/AdditionalPropertiesArray.md
docs/AdditionalPropertiesBoolean.md
docs/AdditionalPropertiesClass.md docs/AdditionalPropertiesClass.md
docs/AdditionalPropertiesInteger.md
docs/AdditionalPropertiesNumber.md
docs/AdditionalPropertiesObject.md
docs/AdditionalPropertiesString.md
docs/Animal.md docs/Animal.md
docs/AnotherFakeApi.md docs/AnotherFakeApi.md
docs/ApiResponse.md docs/ApiResponse.md
docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfArrayOfNumberOnly.md
docs/ArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md
docs/ArrayTest.md docs/ArrayTest.md
docs/BigCat.md
docs/BigCatAllOf.md
docs/Capitalization.md docs/Capitalization.md
docs/Cat.md docs/Cat.md
docs/CatAllOf.md docs/CatAllOf.md
docs/Category.md docs/Category.md
docs/ClassModel.md docs/ClassModel.md
docs/Client.md docs/Client.md
docs/DefaultApi.md
docs/Dog.md docs/Dog.md
docs/DogAllOf.md docs/DogAllOf.md
docs/EnumArrays.md docs/EnumArrays.md
@ -36,32 +28,43 @@ docs/FakeApi.md
docs/FakeClassnameTags123Api.md docs/FakeClassnameTags123Api.md
docs/File.md docs/File.md
docs/FileSchemaTestClass.md docs/FileSchemaTestClass.md
docs/Foo.md
docs/FormatTest.md docs/FormatTest.md
docs/HasOnlyReadOnly.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/List.md
docs/MapTest.md docs/MapTest.md
docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/MixedPropertiesAndAdditionalPropertiesClass.md
docs/Model200Response.md docs/Model200Response.md
docs/ModelReturn.md docs/ModelReturn.md
docs/Name.md docs/Name.md
docs/NullableClass.md
docs/NumberOnly.md docs/NumberOnly.md
docs/Order.md docs/Order.md
docs/OuterComposite.md docs/OuterComposite.md
docs/OuterEnum.md docs/OuterEnum.md
docs/OuterEnumDefaultValue.md
docs/OuterEnumInteger.md
docs/OuterEnumIntegerDefaultValue.md
docs/Pet.md docs/Pet.md
docs/PetApi.md docs/PetApi.md
docs/ReadOnlyFirst.md docs/ReadOnlyFirst.md
docs/SpecialModelName.md docs/SpecialModelName.md
docs/StoreApi.md docs/StoreApi.md
docs/Tag.md docs/Tag.md
docs/TypeHolderDefault.md
docs/TypeHolderExample.md
docs/User.md docs/User.md
docs/UserApi.md docs/UserApi.md
docs/XmlItem.md
git_push.sh git_push.sh
lib/petstore.rb lib/petstore.rb
lib/petstore/api/another_fake_api.rb lib/petstore/api/another_fake_api.rb
lib/petstore/api/default_api.rb
lib/petstore/api/fake_api.rb lib/petstore/api/fake_api.rb
lib/petstore/api/fake_classname_tags123_api.rb lib/petstore/api/fake_classname_tags123_api.rb
lib/petstore/api/pet_api.rb lib/petstore/api/pet_api.rb
@ -71,21 +74,12 @@ lib/petstore/api_client.rb
lib/petstore/api_error.rb lib/petstore/api_error.rb
lib/petstore/configuration.rb lib/petstore/configuration.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_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/animal.rb
lib/petstore/models/api_response.rb lib/petstore/models/api_response.rb
lib/petstore/models/array_of_array_of_number_only.rb lib/petstore/models/array_of_array_of_number_only.rb
lib/petstore/models/array_of_number_only.rb lib/petstore/models/array_of_number_only.rb
lib/petstore/models/array_test.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/capitalization.rb
lib/petstore/models/cat.rb lib/petstore/models/cat.rb
lib/petstore/models/cat_all_of.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/enum_test.rb
lib/petstore/models/file.rb lib/petstore/models/file.rb
lib/petstore/models/file_schema_test_class.rb lib/petstore/models/file_schema_test_class.rb
lib/petstore/models/foo.rb
lib/petstore/models/format_test.rb lib/petstore/models/format_test.rb
lib/petstore/models/has_only_read_only.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/list.rb
lib/petstore/models/map_test.rb lib/petstore/models/map_test.rb
lib/petstore/models/mixed_properties_and_additional_properties_class.rb lib/petstore/models/mixed_properties_and_additional_properties_class.rb
lib/petstore/models/model200_response.rb lib/petstore/models/model200_response.rb
lib/petstore/models/model_return.rb lib/petstore/models/model_return.rb
lib/petstore/models/name.rb lib/petstore/models/name.rb
lib/petstore/models/nullable_class.rb
lib/petstore/models/number_only.rb lib/petstore/models/number_only.rb
lib/petstore/models/order.rb lib/petstore/models/order.rb
lib/petstore/models/outer_composite.rb lib/petstore/models/outer_composite.rb
lib/petstore/models/outer_enum.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/pet.rb
lib/petstore/models/read_only_first.rb lib/petstore/models/read_only_first.rb
lib/petstore/models/special_model_name.rb lib/petstore/models/special_model_name.rb
lib/petstore/models/tag.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/user.rb
lib/petstore/models/xml_item.rb
lib/petstore/version.rb lib/petstore/version.rb
petstore.gemspec 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/api_client_spec.rb
spec/configuration_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 spec/spec_helper.rb

View File

@ -57,11 +57,11 @@ Please follow the [installation](#installation) procedure and then run the follo
require 'petstore' require 'petstore'
api_instance = Petstore::AnotherFakeApi.new api_instance = Petstore::AnotherFakeApi.new
body = Petstore::Client.new # Client | client model client = Petstore::Client.new # Client | client model
begin begin
#To test special tags #To test special tags
result = api_instance.call_123_test_special_tags(body) result = api_instance.call_123_test_special_tags(client)
p result p result
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{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 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::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_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_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_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_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_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_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_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_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_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 ## Documentation for Models
- [Petstore::AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
- [Petstore::AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md)
- [Petstore::AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md)
- [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.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::Animal](docs/Animal.md)
- [Petstore::ApiResponse](docs/ApiResponse.md) - [Petstore::ApiResponse](docs/ApiResponse.md)
- [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Petstore::ArrayTest](docs/ArrayTest.md) - [Petstore::ArrayTest](docs/ArrayTest.md)
- [Petstore::BigCat](docs/BigCat.md)
- [Petstore::BigCatAllOf](docs/BigCatAllOf.md)
- [Petstore::Capitalization](docs/Capitalization.md) - [Petstore::Capitalization](docs/Capitalization.md)
- [Petstore::Cat](docs/Cat.md) - [Petstore::Cat](docs/Cat.md)
- [Petstore::CatAllOf](docs/CatAllOf.md) - [Petstore::CatAllOf](docs/CatAllOf.md)
@ -144,26 +137,36 @@ Class | Method | HTTP request | Description
- [Petstore::EnumTest](docs/EnumTest.md) - [Petstore::EnumTest](docs/EnumTest.md)
- [Petstore::File](docs/File.md) - [Petstore::File](docs/File.md)
- [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Petstore::Foo](docs/Foo.md)
- [Petstore::FormatTest](docs/FormatTest.md) - [Petstore::FormatTest](docs/FormatTest.md)
- [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.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::List](docs/List.md)
- [Petstore::MapTest](docs/MapTest.md) - [Petstore::MapTest](docs/MapTest.md)
- [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Petstore::Model200Response](docs/Model200Response.md) - [Petstore::Model200Response](docs/Model200Response.md)
- [Petstore::ModelReturn](docs/ModelReturn.md) - [Petstore::ModelReturn](docs/ModelReturn.md)
- [Petstore::Name](docs/Name.md) - [Petstore::Name](docs/Name.md)
- [Petstore::NullableClass](docs/NullableClass.md)
- [Petstore::NumberOnly](docs/NumberOnly.md) - [Petstore::NumberOnly](docs/NumberOnly.md)
- [Petstore::Order](docs/Order.md) - [Petstore::Order](docs/Order.md)
- [Petstore::OuterComposite](docs/OuterComposite.md) - [Petstore::OuterComposite](docs/OuterComposite.md)
- [Petstore::OuterEnum](docs/OuterEnum.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::Pet](docs/Pet.md)
- [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md)
- [Petstore::Tag](docs/Tag.md) - [Petstore::Tag](docs/Tag.md)
- [Petstore::TypeHolderDefault](docs/TypeHolderDefault.md)
- [Petstore::TypeHolderExample](docs/TypeHolderExample.md)
- [Petstore::User](docs/User.md) - [Petstore::User](docs/User.md)
- [Petstore::XmlItem](docs/XmlItem.md)
## Documentation for Authorization ## Documentation for Authorization
@ -183,10 +186,17 @@ Class | Method | HTTP request | Description
- **API key parameter name**: api_key_query - **API key parameter name**: api_key_query
- **Location**: URL query string - **Location**: URL query string
### bearer_test
- **Type**: Bearer authentication (JWT)
### http_basic_test ### http_basic_test
- **Type**: HTTP basic authentication - **Type**: HTTP basic authentication
### http_signature_test
### petstore_auth ### petstore_auth

View File

@ -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)
```

View File

@ -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)
```

View File

@ -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)
```

View File

@ -4,34 +4,16 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**map_string** | **Hash&lt;String, String&gt;** | | [optional] **map_property** | **Hash&lt;String, String&gt;** | | [optional]
**map_number** | **Hash&lt;String, Float&gt;** | | [optional] **map_of_map_property** | **Hash&lt;String, Hash&lt;String, String&gt;&gt;** | | [optional]
**map_integer** | **Hash&lt;String, Integer&gt;** | | [optional]
**map_boolean** | **Hash&lt;String, Boolean&gt;** | | [optional]
**map_array_integer** | **Hash&lt;String, Array&lt;Integer&gt;&gt;** | | [optional]
**map_array_anytype** | **Hash&lt;String, Array&lt;Object&gt;&gt;** | | [optional]
**map_map_string** | **Hash&lt;String, Hash&lt;String, String&gt;&gt;** | | [optional]
**map_map_anytype** | **Hash&lt;String, Hash&lt;String, Object&gt;&gt;** | | [optional]
**anytype_1** | **Object** | | [optional]
**anytype_2** | **Object** | | [optional]
**anytype_3** | **Object** | | [optional]
## Code Sample ## Code Sample
```ruby ```ruby
require 'Petstore' require 'Petstore'
instance = Petstore::AdditionalPropertiesClass.new(map_string: null, instance = Petstore::AdditionalPropertiesClass.new(map_property: null,
map_number: null, map_of_map_property: 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)
``` ```

View File

@ -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)
```

View File

@ -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)
```

View File

@ -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)
```

View File

@ -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)
```

View File

@ -10,7 +10,7 @@ Method | HTTP request | Description
## call_123_test_special_tags ## call_123_test_special_tags
> Client call_123_test_special_tags(body) > Client call_123_test_special_tags(client)
To test special tags To test special tags
@ -23,11 +23,11 @@ To test special tags and operation ID starting with number
require 'petstore' require 'petstore'
api_instance = Petstore::AnotherFakeApi.new api_instance = Petstore::AnotherFakeApi.new
body = Petstore::Client.new # Client | client model client = Petstore::Client.new # Client | client model
begin begin
#To test special tags #To test special tags
result = api_instance.call_123_test_special_tags(body) result = api_instance.call_123_test_special_tags(client)
p result p result
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}"
@ -39,7 +39,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model | **client** | [**Client**](Client.md)| client model |
### Return type ### Return type

View File

@ -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)
```

View File

@ -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)
```

View File

@ -9,6 +9,9 @@ Name | Type | Description | Notes
**enum_integer** | **Integer** | | [optional] **enum_integer** | **Integer** | | [optional]
**enum_number** | **Float** | | [optional] **enum_number** | **Float** | | [optional]
**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [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 ## Code Sample
@ -19,7 +22,10 @@ instance = Petstore::EnumTest.new(enum_string: null,
enum_string_required: null, enum_string_required: null,
enum_integer: null, enum_integer: null,
enum_number: 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)
``` ```

View File

@ -4,7 +4,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description 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_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_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_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_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_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 \&quot;client\&quot; model [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; 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_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_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_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
@ -21,13 +22,11 @@ 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 ### Example
@ -36,13 +35,61 @@ this route creates an XmlItem
require 'petstore' require 'petstore'
api_instance = Petstore::FakeApi.new api_instance = Petstore::FakeApi.new
xml_item = Petstore::XmlItem.new # XmlItem | XmlItem Body
begin begin
#creates an XmlItem #Health check endpoint
api_instance.create_xml_item(xml_item) result = api_instance.fake_health_get
p result
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling FakeApi->create_xml_item: #{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 end
``` ```
@ -51,7 +98,9 @@ end
Name | Type | Description | Notes 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 ### Return type
@ -59,11 +108,11 @@ nil (empty response body)
### Authorization ### Authorization
No authorization required [http_signature_test](../README.md#http_signature_test)
### HTTP request headers ### 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 - **Accept**: Not defined
@ -111,7 +160,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: */* - **Accept**: */*
@ -131,7 +180,7 @@ require 'petstore'
api_instance = Petstore::FakeApi.new api_instance = Petstore::FakeApi.new
opts = { opts = {
body: Petstore::OuterComposite.new # OuterComposite | Input composite as post body outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body
} }
begin begin
@ -147,7 +196,7 @@ end
Name | Type | Description | Notes 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 ### Return type
@ -159,7 +208,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: */* - **Accept**: */*
@ -207,7 +256,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: */* - **Accept**: */*
@ -255,13 +304,13 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: */* - **Accept**: */*
## test_body_with_file_schema ## 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' require 'petstore'
api_instance = Petstore::FakeApi.new api_instance = Petstore::FakeApi.new
body = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass |
begin begin
api_instance.test_body_with_file_schema(body) api_instance.test_body_with_file_schema(file_schema_test_class)
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}" puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}"
end end
@ -288,7 +337,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type ### Return type
@ -306,7 +355,7 @@ No authorization required
## test_body_with_query_params ## 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 api_instance = Petstore::FakeApi.new
query = 'query_example' # String | query = 'query_example' # String |
body = Petstore::User.new # User | user = Petstore::User.new # User |
begin begin
api_instance.test_body_with_query_params(query, body) api_instance.test_body_with_query_params(query, user)
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling FakeApi->test_body_with_query_params: #{e}" puts "Exception when calling FakeApi->test_body_with_query_params: #{e}"
end end
@ -333,7 +382,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**query** | **String**| | **query** | **String**| |
**body** | [**User**](User.md)| | **user** | [**User**](User.md)| |
### Return type ### Return type
@ -351,7 +400,7 @@ No authorization required
## test_client_model ## test_client_model
> Client test_client_model(body) > Client test_client_model(client)
To test \"client\" model To test \"client\" model
@ -364,11 +413,11 @@ To test \"client\" model
require 'petstore' require 'petstore'
api_instance = Petstore::FakeApi.new api_instance = Petstore::FakeApi.new
body = Petstore::Client.new # Client | client model client = Petstore::Client.new # Client | client model
begin begin
#To test \"client\" model #To test \"client\" model
result = api_instance.test_client_model(body) result = api_instance.test_client_model(client)
p result p result
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling FakeApi->test_client_model: #{e}" puts "Exception when calling FakeApi->test_client_model: #{e}"
@ -380,7 +429,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model | **client** | [**Client**](Client.md)| client model |
### Return type ### Return type
@ -400,9 +449,9 @@ No authorization required
> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) > 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 ### Example
@ -435,7 +484,7 @@ opts = {
} }
begin 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) api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts)
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling FakeApi->test_endpoint_parameters: #{e}" puts "Exception when calling FakeApi->test_endpoint_parameters: #{e}"
@ -551,6 +600,11 @@ Fake endpoint to test group parameters (optional)
```ruby ```ruby
# load the gem # load the gem
require 'petstore' 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 api_instance = Petstore::FakeApi.new
required_string_group = 56 # Integer | Required String in group parameters required_string_group = 56 # Integer | Required String in group parameters
@ -588,7 +642,7 @@ nil (empty response body)
### Authorization ### Authorization
No authorization required [bearer_test](../README.md#bearer_test)
### HTTP request headers ### HTTP request headers
@ -598,7 +652,7 @@ No authorization required
## test_inline_additional_properties ## test_inline_additional_properties
> test_inline_additional_properties(param) > test_inline_additional_properties(request_body)
test inline additionalProperties test inline additionalProperties
@ -609,11 +663,11 @@ test inline additionalProperties
require 'petstore' require 'petstore'
api_instance = Petstore::FakeApi.new api_instance = Petstore::FakeApi.new
param = {'key' => 'param_example'} # Hash<String, String> | request body request_body = {'key' => 'request_body_example'} # Hash<String, String> | request body
begin begin
#test inline additionalProperties #test inline additionalProperties
api_instance.test_inline_additional_properties(param) api_instance.test_inline_additional_properties(request_body)
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}"
end end
@ -624,7 +678,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**param** | [**Hash&lt;String, String&gt;**](String.md)| request body | **request_body** | [**Hash&lt;String, String&gt;**](String.md)| request body |
### Return type ### Return type

View File

@ -10,7 +10,7 @@ Method | HTTP request | Description
## test_classname ## test_classname
> Client test_classname(body) > Client test_classname(client)
To test class name in snake case To test class name in snake case
@ -30,11 +30,11 @@ Petstore.configure do |config|
end end
api_instance = Petstore::FakeClassnameTags123Api.new api_instance = Petstore::FakeClassnameTags123Api.new
body = Petstore::Client.new # Client | client model client = Petstore::Client.new # Client | client model
begin begin
#To test class name in snake case #To test class name in snake case
result = api_instance.test_classname(body) result = api_instance.test_classname(client)
p result p result
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}" puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}"
@ -46,7 +46,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model | **client** | [**Client**](Client.md)| client model |
### Return type ### Return type

View File

@ -17,7 +17,8 @@ Name | Type | Description | Notes
**date_time** | **DateTime** | | [optional] **date_time** | **DateTime** | | [optional]
**uuid** | **String** | | [optional] **uuid** | **String** | | [optional]
**password** | **String** | | **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 &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
## Code Sample ## Code Sample
@ -37,7 +38,8 @@ instance = Petstore::FormatTest.new(integer: null,
date_time: null, date_time: null,
uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84, uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84,
password: null, password: null,
big_decimal: null) pattern_with_digits: null,
pattern_with_digits_and_delimiter: null)
``` ```

View File

@ -18,7 +18,7 @@ Method | HTTP request | Description
## add_pet ## add_pet
> add_pet(body) > add_pet(pet)
Add a new pet to the store Add a new pet to the store
@ -34,11 +34,11 @@ Petstore.configure do |config|
end end
api_instance = Petstore::PetApi.new 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 begin
#Add a new pet to the store #Add a new pet to the store
api_instance.add_pet(body) api_instance.add_pet(pet)
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling PetApi->add_pet: #{e}" puts "Exception when calling PetApi->add_pet: #{e}"
end end
@ -49,7 +49,7 @@ end
Name | Type | Description | Notes 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 ### Return type
@ -278,7 +278,7 @@ Name | Type | Description | Notes
## update_pet ## update_pet
> update_pet(body) > update_pet(pet)
Update an existing pet Update an existing pet
@ -294,11 +294,11 @@ Petstore.configure do |config|
end end
api_instance = Petstore::PetApi.new 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 begin
#Update an existing pet #Update an existing pet
api_instance.update_pet(body) api_instance.update_pet(pet)
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling PetApi->update_pet: #{e}" puts "Exception when calling PetApi->update_pet: #{e}"
end end
@ -309,7 +309,7 @@ end
Name | Type | Description | Notes 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 ### Return type

View File

@ -156,7 +156,7 @@ No authorization required
## place_order ## place_order
> Order place_order(body) > Order place_order(order)
Place an order for a pet Place an order for a pet
@ -167,11 +167,11 @@ Place an order for a pet
require 'petstore' require 'petstore'
api_instance = Petstore::StoreApi.new 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 begin
#Place an order for a pet #Place an order for a pet
result = api_instance.place_order(body) result = api_instance.place_order(order)
p result p result
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling StoreApi->place_order: #{e}" puts "Exception when calling StoreApi->place_order: #{e}"
@ -183,7 +183,7 @@ end
Name | Type | Description | Notes 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 ### Return type
@ -195,6 +195,6 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: application/xml, application/json - **Accept**: application/xml, application/json

View File

@ -1,25 +0,0 @@
# Petstore::TypeHolderDefault
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string_item** | **String** | | [default to &#39;what&#39;]
**number_item** | **Float** | |
**integer_item** | **Integer** | |
**bool_item** | **Boolean** | | [default to true]
**array_item** | **Array&lt;Integer&gt;** | |
## Code Sample
```ruby
require 'Petstore'
instance = Petstore::TypeHolderDefault.new(string_item: null,
number_item: null,
integer_item: null,
bool_item: null,
array_item: null)
```

View File

@ -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&lt;Integer&gt;** | |
## 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])
```

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
## create_user ## create_user
> create_user(body) > create_user(user)
Create user Create user
@ -30,11 +30,11 @@ This can only be done by the logged in user.
require 'petstore' require 'petstore'
api_instance = Petstore::UserApi.new api_instance = Petstore::UserApi.new
body = Petstore::User.new # User | Created user object user = Petstore::User.new # User | Created user object
begin begin
#Create user #Create user
api_instance.create_user(body) api_instance.create_user(user)
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling UserApi->create_user: #{e}" puts "Exception when calling UserApi->create_user: #{e}"
end end
@ -45,7 +45,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object | **user** | [**User**](User.md)| Created user object |
### Return type ### Return type
@ -57,13 +57,13 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: Not defined - **Accept**: Not defined
## create_users_with_array_input ## 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 Creates list of users with given input array
@ -74,11 +74,11 @@ Creates list of users with given input array
require 'petstore' require 'petstore'
api_instance = Petstore::UserApi.new api_instance = Petstore::UserApi.new
body = [Petstore::User.new] # Array<User> | List of user object user = [Petstore::User.new] # Array<User> | List of user object
begin begin
#Creates list of users with given input array #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 rescue Petstore::ApiError => e
puts "Exception when calling UserApi->create_users_with_array_input: #{e}" puts "Exception when calling UserApi->create_users_with_array_input: #{e}"
end end
@ -89,7 +89,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Array&lt;User&gt;**](User.md)| List of user object | **user** | [**Array&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@ -101,13 +101,13 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: Not defined - **Accept**: Not defined
## create_users_with_list_input ## 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 Creates list of users with given input array
@ -118,11 +118,11 @@ Creates list of users with given input array
require 'petstore' require 'petstore'
api_instance = Petstore::UserApi.new api_instance = Petstore::UserApi.new
body = [Petstore::User.new] # Array<User> | List of user object user = [Petstore::User.new] # Array<User> | List of user object
begin begin
#Creates list of users with given input array #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 rescue Petstore::ApiError => e
puts "Exception when calling UserApi->create_users_with_list_input: #{e}" puts "Exception when calling UserApi->create_users_with_list_input: #{e}"
end end
@ -133,7 +133,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Array&lt;User&gt;**](User.md)| List of user object | **user** | [**Array&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@ -145,7 +145,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: Not defined - **Accept**: Not defined
@ -329,7 +329,7 @@ No authorization required
## update_user ## update_user
> update_user(username, body) > update_user(username, user)
Updated user Updated user
@ -343,11 +343,11 @@ require 'petstore'
api_instance = Petstore::UserApi.new api_instance = Petstore::UserApi.new
username = 'username_example' # String | name that need to be deleted 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 begin
#Updated user #Updated user
api_instance.update_user(username, body) api_instance.update_user(username, user)
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling UserApi->update_user: #{e}" puts "Exception when calling UserApi->update_user: #{e}"
end end
@ -359,7 +359,7 @@ end
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted | **username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object | **user** | [**User**](User.md)| Updated user object |
### Return type ### Return type
@ -371,6 +371,6 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: Not defined - **Accept**: Not defined

View File

@ -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&lt;Integer&gt;** | | [optional]
**name_string** | **String** | | [optional]
**name_number** | **Float** | | [optional]
**name_integer** | **Integer** | | [optional]
**name_boolean** | **Boolean** | | [optional]
**name_array** | **Array&lt;Integer&gt;** | | [optional]
**name_wrapped_array** | **Array&lt;Integer&gt;** | | [optional]
**prefix_string** | **String** | | [optional]
**prefix_number** | **Float** | | [optional]
**prefix_integer** | **Integer** | | [optional]
**prefix_boolean** | **Boolean** | | [optional]
**prefix_array** | **Array&lt;Integer&gt;** | | [optional]
**prefix_wrapped_array** | **Array&lt;Integer&gt;** | | [optional]
**namespace_string** | **String** | | [optional]
**namespace_number** | **Float** | | [optional]
**namespace_integer** | **Integer** | | [optional]
**namespace_boolean** | **Boolean** | | [optional]
**namespace_array** | **Array&lt;Integer&gt;** | | [optional]
**namespace_wrapped_array** | **Array&lt;Integer&gt;** | | [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&lt;Integer&gt;** | | [optional]
**prefix_ns_wrapped_array** | **Array&lt;Integer&gt;** | | [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)
```

View File

@ -17,21 +17,12 @@ require 'petstore/version'
require 'petstore/configuration' require 'petstore/configuration'
# Models # 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_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/animal'
require 'petstore/models/api_response' require 'petstore/models/api_response'
require 'petstore/models/array_of_array_of_number_only' require 'petstore/models/array_of_array_of_number_only'
require 'petstore/models/array_of_number_only' require 'petstore/models/array_of_number_only'
require 'petstore/models/array_test' require 'petstore/models/array_test'
require 'petstore/models/big_cat'
require 'petstore/models/big_cat_all_of'
require 'petstore/models/capitalization' require 'petstore/models/capitalization'
require 'petstore/models/cat' require 'petstore/models/cat'
require 'petstore/models/cat_all_of' require 'petstore/models/cat_all_of'
@ -45,29 +36,40 @@ require 'petstore/models/enum_class'
require 'petstore/models/enum_test' require 'petstore/models/enum_test'
require 'petstore/models/file' require 'petstore/models/file'
require 'petstore/models/file_schema_test_class' require 'petstore/models/file_schema_test_class'
require 'petstore/models/foo'
require 'petstore/models/format_test' require 'petstore/models/format_test'
require 'petstore/models/has_only_read_only' 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/list'
require 'petstore/models/map_test' require 'petstore/models/map_test'
require 'petstore/models/mixed_properties_and_additional_properties_class' require 'petstore/models/mixed_properties_and_additional_properties_class'
require 'petstore/models/model200_response' require 'petstore/models/model200_response'
require 'petstore/models/model_return' require 'petstore/models/model_return'
require 'petstore/models/name' require 'petstore/models/name'
require 'petstore/models/nullable_class'
require 'petstore/models/number_only' require 'petstore/models/number_only'
require 'petstore/models/order' require 'petstore/models/order'
require 'petstore/models/outer_composite' require 'petstore/models/outer_composite'
require 'petstore/models/outer_enum' 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/pet'
require 'petstore/models/read_only_first' require 'petstore/models/read_only_first'
require 'petstore/models/special_model_name' require 'petstore/models/special_model_name'
require 'petstore/models/tag' require 'petstore/models/tag'
require 'petstore/models/type_holder_default'
require 'petstore/models/type_holder_example'
require 'petstore/models/user' require 'petstore/models/user'
require 'petstore/models/xml_item'
# APIs # APIs
require 'petstore/api/another_fake_api' require 'petstore/api/another_fake_api'
require 'petstore/api/default_api'
require 'petstore/api/fake_api' require 'petstore/api/fake_api'
require 'petstore/api/fake_classname_tags123_api' require 'petstore/api/fake_classname_tags123_api'
require 'petstore/api/pet_api' require 'petstore/api/pet_api'

View File

@ -21,26 +21,26 @@ module Petstore
end end
# To test special tags # To test special tags
# To test special tags and operation ID starting with number # 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 # @param [Hash] opts the optional parameters
# @return [Client] # @return [Client]
def call_123_test_special_tags(body, opts = {}) def call_123_test_special_tags(client, opts = {})
data, _status_code, _headers = call_123_test_special_tags_with_http_info(body, opts) data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts)
data data
end end
# To test special tags # To test special tags
# To test special tags and operation ID starting with number # 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 # @param [Hash] opts the optional parameters
# @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'client' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && client.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling AnotherFakeApi.call_123_test_special_tags" fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags"
end end
# resource path # resource path
local_var_path = '/another-fake/dummy' local_var_path = '/another-fake/dummy'
@ -59,7 +59,7 @@ module Petstore
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] || 'Client' return_type = opts[:return_type] || 'Client'

View File

@ -19,48 +19,40 @@ module Petstore
def initialize(api_client = ApiClient.default) def initialize(api_client = ApiClient.default)
@api_client = api_client @api_client = api_client
end end
# creates an XmlItem # Health check endpoint
# this route creates an XmlItem
# @param xml_item [XmlItem] XmlItem Body
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [HealthCheckResult]
def create_xml_item(xml_item, opts = {}) def fake_health_get(opts = {})
create_xml_item_with_http_info(xml_item, opts) data, _status_code, _headers = fake_health_get_with_http_info(opts)
nil data
end end
# creates an XmlItem # Health check endpoint
# this route creates an XmlItem
# @param xml_item [XmlItem] XmlItem Body
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @return [Array<(HealthCheckResult, Integer, Hash)>] HealthCheckResult data, response status code and response headers
def create_xml_item_with_http_info(xml_item, opts = {}) def fake_health_get_with_http_info(opts = {})
if @api_client.config.debugging 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_health_get ...'
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"
end end
# resource path # resource path
local_var_path = '/fake/create_xml_item' local_var_path = '/fake/health'
# query parameters # query parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
# header parameters # header parameters
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Content-Type' # HTTP header 'Accept' (if needed)
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['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters # form parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(xml_item) post_body = opts[:body]
# return_type # return_type
return_type = opts[:return_type] return_type = opts[:return_type] || 'HealthCheckResult'
# auth_names # auth_names
auth_names = opts[:auth_names] || [] auth_names = opts[:auth_names] || []
@ -74,9 +66,75 @@ module Petstore
:return_type => return_type :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 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_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 end
return data, status_code, headers return data, status_code, headers
end end
@ -108,6 +166,8 @@ module Petstore
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed) # HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*']) 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 parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
@ -139,7 +199,7 @@ module Petstore
# Test serialization of object with outer number type # Test serialization of object with outer number type
# @param [Hash] opts the optional parameters # @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] # @return [OuterComposite]
def fake_outer_composite_serialize(opts = {}) def fake_outer_composite_serialize(opts = {})
data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts)
@ -148,7 +208,7 @@ module Petstore
# Test serialization of object with outer number type # Test serialization of object with outer number type
# @param [Hash] opts the optional parameters # @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 # @return [Array<(OuterComposite, Integer, Hash)>] OuterComposite data, response status code and response headers
def fake_outer_composite_serialize_with_http_info(opts = {}) def fake_outer_composite_serialize_with_http_info(opts = {})
if @api_client.config.debugging if @api_client.config.debugging
@ -164,12 +224,14 @@ module Petstore
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed) # HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*']) 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 parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] || 'OuterComposite' return_type = opts[:return_type] || 'OuterComposite'
@ -220,6 +282,8 @@ module Petstore
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed) # HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*']) 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 parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
@ -276,6 +340,8 @@ module Petstore
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed) # HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*']) 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 parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
@ -306,25 +372,25 @@ module Petstore
end end
# For this test, the body for this request much reference a schema named `File`. # 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def test_body_with_file_schema(body, opts = {}) def test_body_with_file_schema(file_schema_test_class, opts = {})
test_body_with_file_schema_with_http_info(body, opts) test_body_with_file_schema_with_http_info(file_schema_test_class, opts)
nil nil
end end
# For this test, the body for this request much reference a schema named &#x60;File&#x60;. # For this test, the body for this request much reference a schema named &#x60;File&#x60;.
# @param body [FileSchemaTestClass] # @param file_schema_test_class [FileSchemaTestClass]
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...' @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'file_schema_test_class' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && file_schema_test_class.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_body_with_file_schema" fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema"
end end
# resource path # resource path
local_var_path = '/fake/body-with-file-schema' local_var_path = '/fake/body-with-file-schema'
@ -341,7 +407,7 @@ module Petstore
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]
@ -366,19 +432,19 @@ module Petstore
end end
# @param query [String] # @param query [String]
# @param body [User] # @param user [User]
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def test_body_with_query_params(query, body, opts = {}) def test_body_with_query_params(query, user, opts = {})
test_body_with_query_params_with_http_info(query, body, opts) test_body_with_query_params_with_http_info(query, user, opts)
nil nil
end end
# @param query [String] # @param query [String]
# @param body [User] # @param user [User]
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...' @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...'
end end
@ -386,9 +452,9 @@ module Petstore
if @api_client.config.client_side_validation && query.nil? if @api_client.config.client_side_validation && query.nil?
fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params" fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params"
end end
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && user.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_body_with_query_params" fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params"
end end
# resource path # resource path
local_var_path = '/fake/body-with-query-params' local_var_path = '/fake/body-with-query-params'
@ -406,7 +472,7 @@ module Petstore
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]
@ -432,26 +498,26 @@ module Petstore
# To test \"client\" model # To test \"client\" model
# To test \"client\" model # To test \"client\" model
# @param body [Client] client model # @param client [Client] client model
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Client] # @return [Client]
def test_client_model(body, opts = {}) def test_client_model(client, opts = {})
data, _status_code, _headers = test_client_model_with_http_info(body, opts) data, _status_code, _headers = test_client_model_with_http_info(client, opts)
data data
end end
# To test \&quot;client\&quot; model # To test \&quot;client\&quot; model
# To test \&quot;client\&quot; model # To test \&quot;client\&quot; model
# @param body [Client] client model # @param client [Client] client model
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...' @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'client' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && client.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_client_model" fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model"
end end
# resource path # resource path
local_var_path = '/fake' local_var_path = '/fake'
@ -470,7 +536,7 @@ module Petstore
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] || 'Client' return_type = opts[:return_type] || 'Client'
@ -494,8 +560,8 @@ module Petstore
return data, status_code, headers return data, status_code, headers
end 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 number [Float] None
# @param double [Float] None # @param double [Float] None
# @param pattern_without_delimiter [String] None # @param pattern_without_delimiter [String] None
@ -517,8 +583,8 @@ module Petstore
nil nil
end 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 number [Float] None
# @param double [Float] None # @param double [Float] None
# @param pattern_without_delimiter [String] None # @param pattern_without_delimiter [String] None
@ -732,7 +798,7 @@ module Petstore
# query parameters # query parameters
query_params = opts[:query_params] || {} 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_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_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? query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil?
@ -840,7 +906,7 @@ module Petstore
return_type = opts[:return_type] return_type = opts[:return_type]
# auth_names # auth_names
auth_names = opts[:auth_names] || [] auth_names = opts[:auth_names] || ['bearer_test']
new_options = opts.merge( new_options = opts.merge(
:header_params => header_params, :header_params => header_params,
@ -859,25 +925,25 @@ module Petstore
end end
# test inline additionalProperties # test inline additionalProperties
# @param param [Hash<String, String>] request body # @param request_body [Hash<String, String>] request body
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def test_inline_additional_properties(param, opts = {}) def test_inline_additional_properties(request_body, opts = {})
test_inline_additional_properties_with_http_info(param, opts) test_inline_additional_properties_with_http_info(request_body, opts)
nil nil
end end
# test inline additionalProperties # test inline additionalProperties
# @param param [Hash<String, String>] request body # @param request_body [Hash<String, String>] request body
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...' @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...'
end end
# verify the required parameter 'param' is set # verify the required parameter 'request_body' is set
if @api_client.config.client_side_validation && param.nil? if @api_client.config.client_side_validation && request_body.nil?
fail ArgumentError, "Missing the required parameter 'param' when calling FakeApi.test_inline_additional_properties" fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties"
end end
# resource path # resource path
local_var_path = '/fake/inline-additionalProperties' local_var_path = '/fake/inline-additionalProperties'
@ -894,7 +960,7 @@ module Petstore
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]
@ -1036,7 +1102,7 @@ module Petstore
# query parameters # query parameters
query_params = opts[:query_params] || {} 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[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv)
query_params[:'http'] = @api_client.build_collection_param(http, :space) query_params[:'http'] = @api_client.build_collection_param(http, :space)
query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'url'] = @api_client.build_collection_param(url, :csv)

View File

@ -21,26 +21,26 @@ module Petstore
end end
# To test class name in snake case # To test class name in snake case
# 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 # @param [Hash] opts the optional parameters
# @return [Client] # @return [Client]
def test_classname(body, opts = {}) def test_classname(client, opts = {})
data, _status_code, _headers = test_classname_with_http_info(body, opts) data, _status_code, _headers = test_classname_with_http_info(client, opts)
data data
end end
# To test class name in snake case # To test class name in snake case
# 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 # @param [Hash] opts the optional parameters
# @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...' @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'client' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && client.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling FakeClassnameTags123Api.test_classname" fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname"
end end
# resource path # resource path
local_var_path = '/fake_classname_test' local_var_path = '/fake_classname_test'
@ -59,7 +59,7 @@ module Petstore
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] || 'Client' return_type = opts[:return_type] || 'Client'

View File

@ -20,25 +20,25 @@ module Petstore
@api_client = api_client @api_client = api_client
end end
# Add a new pet to the store # 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def add_pet(body, opts = {}) def add_pet(pet, opts = {})
add_pet_with_http_info(body, opts) add_pet_with_http_info(pet, opts)
nil nil
end end
# Add a new pet to the store # 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 # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PetApi.add_pet ...' @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'pet' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && pet.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.add_pet" fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet"
end end
# resource path # resource path
local_var_path = '/pet' local_var_path = '/pet'
@ -55,7 +55,7 @@ module Petstore
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]
@ -103,7 +103,7 @@ module Petstore
fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
@ -290,7 +290,7 @@ module Petstore
fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
@ -329,25 +329,25 @@ module Petstore
end end
# Update an existing pet # 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def update_pet(body, opts = {}) def update_pet(pet, opts = {})
update_pet_with_http_info(body, opts) update_pet_with_http_info(pet, opts)
nil nil
end end
# Update an existing pet # 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 # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PetApi.update_pet ...' @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'pet' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && pet.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.update_pet" fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet"
end end
# resource path # resource path
local_var_path = '/pet' local_var_path = '/pet'
@ -364,7 +364,7 @@ module Petstore
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]
@ -414,7 +414,7 @@ module Petstore
fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
@ -480,7 +480,7 @@ module Petstore
fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
@ -552,7 +552,7 @@ module Petstore
fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}

View File

@ -43,7 +43,7 @@ module Petstore
fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
@ -167,7 +167,7 @@ module Petstore
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
@ -206,25 +206,25 @@ module Petstore
end end
# Place an order for a pet # 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 # @param [Hash] opts the optional parameters
# @return [Order] # @return [Order]
def place_order(body, opts = {}) def place_order(order, opts = {})
data, _status_code, _headers = place_order_with_http_info(body, opts) data, _status_code, _headers = place_order_with_http_info(order, opts)
data data
end end
# Place an order for a pet # 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 # @param [Hash] opts the optional parameters
# @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: StoreApi.place_order ...' @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'order' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && order.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling StoreApi.place_order" fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order"
end end
# resource path # resource path
local_var_path = '/store/order' local_var_path = '/store/order'
@ -236,12 +236,14 @@ module Petstore
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed) # HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) 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 parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] || 'Order' return_type = opts[:return_type] || 'Order'

View File

@ -21,26 +21,26 @@ module Petstore
end end
# Create user # Create user
# This can only be done by the logged in 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def create_user(body, opts = {}) def create_user(user, opts = {})
create_user_with_http_info(body, opts) create_user_with_http_info(user, opts)
nil nil
end end
# Create user # Create user
# This can only be done by the logged in 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 # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: UserApi.create_user ...' @api_client.config.logger.debug 'Calling API: UserApi.create_user ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && user.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_user" fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user"
end end
# resource path # resource path
local_var_path = '/user' local_var_path = '/user'
@ -50,12 +50,14 @@ module Petstore
# header parameters # header parameters
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters # form parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]
@ -80,25 +82,25 @@ module Petstore
end end
# Creates list of users with given input array # Creates list of users with given input array
# @param body [Array<User>] List of user object # @param user [Array<User>] List of user object
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def create_users_with_array_input(body, opts = {}) def create_users_with_array_input(user, opts = {})
create_users_with_array_input_with_http_info(body, opts) create_users_with_array_input_with_http_info(user, opts)
nil nil
end end
# Creates list of users with given input array # Creates list of users with given input array
# @param body [Array<User>] List of user object # @param user [Array<User>] List of user object
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...' @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && user.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_array_input" fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input"
end end
# resource path # resource path
local_var_path = '/user/createWithArray' local_var_path = '/user/createWithArray'
@ -108,12 +110,14 @@ module Petstore
# header parameters # header parameters
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters # form parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]
@ -138,25 +142,25 @@ module Petstore
end end
# Creates list of users with given input array # Creates list of users with given input array
# @param body [Array<User>] List of user object # @param user [Array<User>] List of user object
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def create_users_with_list_input(body, opts = {}) def create_users_with_list_input(user, opts = {})
create_users_with_list_input_with_http_info(body, opts) create_users_with_list_input_with_http_info(user, opts)
nil nil
end end
# Creates list of users with given input array # Creates list of users with given input array
# @param body [Array<User>] List of user object # @param user [Array<User>] List of user object
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...' @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...'
end end
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && user.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_list_input" fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input"
end end
# resource path # resource path
local_var_path = '/user/createWithList' local_var_path = '/user/createWithList'
@ -166,12 +170,14 @@ module Petstore
# header parameters # header parameters
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters # form parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]
@ -219,7 +225,7 @@ module Petstore
fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
@ -277,7 +283,7 @@ module Petstore
fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
@ -438,21 +444,21 @@ module Petstore
# Updated user # Updated user
# This can only be done by the logged in user. # This can only be done by the logged in user.
# @param username [String] name that need to be deleted # @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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
def update_user(username, body, opts = {}) def update_user(username, user, opts = {})
update_user_with_http_info(username, body, opts) update_user_with_http_info(username, user, opts)
nil nil
end end
# Updated user # Updated user
# This can only be done by the logged in user. # This can only be done by the logged in user.
# @param username [String] name that need to be deleted # @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 # @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers # @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 if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: UserApi.update_user ...' @api_client.config.logger.debug 'Calling API: UserApi.update_user ...'
end end
@ -460,24 +466,26 @@ module Petstore
if @api_client.config.client_side_validation && username.nil? if @api_client.config.client_side_validation && username.nil?
fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user" fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user"
end end
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
if @api_client.config.client_side_validation && body.nil? if @api_client.config.client_side_validation && user.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.update_user" fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user"
end end
# resource path # 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 parameters
query_params = opts[:query_params] || {} query_params = opts[:query_params] || {}
# header parameters # header parameters
header_params = opts[:header_params] || {} header_params = opts[:header_params] || {}
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters # form parameters
form_params = opts[:form_params] || {} form_params = opts[:form_params] || {}
# http body (model) # 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
return_type = opts[:return_type] return_type = opts[:return_type]

View File

@ -202,6 +202,14 @@ module Petstore
key: 'api_key_query', key: 'api_key_query',
value: api_key_with_prefix('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' => 'http_basic_test' =>
{ {
type: 'basic', type: 'basic',
@ -223,8 +231,41 @@ module Petstore
def server_settings def server_settings
[ [
{ {
url: "http://petstore.swagger.io:80/v2", url: "http://{server}.swagger.io:{port}/v2",
description: "No description provided", 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 end

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -14,59 +14,23 @@ require 'date'
module Petstore module Petstore
class AdditionalPropertiesClass class AdditionalPropertiesClass
attr_accessor :map_string attr_accessor :map_property
attr_accessor :map_number attr_accessor :map_of_map_property
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
# Attribute mapping from ruby-style variable name to JSON key. # Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map def self.attribute_map
{ {
:'map_string' => :'map_string', :'map_property' => :'map_property',
:'map_number' => :'map_number', :'map_of_map_property' => :'map_of_map_property'
:'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'
} }
end end
# Attribute type mapping. # Attribute type mapping.
def self.openapi_types def self.openapi_types
{ {
:'map_string' => :'Hash<String, String>', :'map_property' => :'Hash<String, String>',
:'map_number' => :'Hash<String, Float>', :'map_of_map_property' => :'Hash<String, Hash<String, String>>'
:'map_integer' => :'Hash<String, Integer>',
:'map_boolean' => :'Hash<String, Boolean>',
:'map_array_integer' => :'Hash<String, Array<Integer>>',
:'map_array_anytype' => :'Hash<String, Array<Object>>',
:'map_map_string' => :'Hash<String, Hash<String, String>>',
:'map_map_anytype' => :'Hash<String, Hash<String, Object>>',
:'anytype_1' => :'Object',
:'anytype_2' => :'Object',
:'anytype_3' => :'Object'
} }
end end
@ -91,65 +55,17 @@ module Petstore
h[k.to_sym] = v h[k.to_sym] = v
} }
if attributes.key?(:'map_string') if attributes.key?(:'map_property')
if (value = attributes[:'map_string']).is_a?(Hash) if (value = attributes[:'map_property']).is_a?(Hash)
self.map_string = value self.map_property = value
end end
end end
if attributes.key?(:'map_number') if attributes.key?(:'map_of_map_property')
if (value = attributes[:'map_number']).is_a?(Hash) if (value = attributes[:'map_of_map_property']).is_a?(Hash)
self.map_number = value self.map_of_map_property = value
end end
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 end
# Show invalid properties with the reasons. Usually used together with valid? # Show invalid properties with the reasons. Usually used together with valid?
@ -170,17 +86,8 @@ module Petstore
def ==(o) def ==(o)
return true if self.equal?(o) return true if self.equal?(o)
self.class == o.class && self.class == o.class &&
map_string == o.map_string && map_property == o.map_property &&
map_number == o.map_number && map_of_map_property == o.map_of_map_property
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
end end
# @see the `==` method # @see the `==` method
@ -192,7 +99,7 @@ module Petstore
# Calculates hash code according to all attributes. # Calculates hash code according to all attributes.
# @return [Integer] Hash code # @return [Integer] Hash code
def hash 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 end
# Builds the object from hash # Builds the object from hash

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -24,6 +24,12 @@ module Petstore
attr_accessor :outer_enum attr_accessor :outer_enum
attr_accessor :outer_enum_integer
attr_accessor :outer_enum_default_value
attr_accessor :outer_enum_integer_default_value
class EnumAttributeValidator class EnumAttributeValidator
attr_reader :datatype attr_reader :datatype
attr_reader :allowable_values attr_reader :allowable_values
@ -53,7 +59,10 @@ module Petstore
:'enum_string_required' => :'enum_string_required', :'enum_string_required' => :'enum_string_required',
:'enum_integer' => :'enum_integer', :'enum_integer' => :'enum_integer',
:'enum_number' => :'enum_number', :'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 end
@ -64,13 +73,17 @@ module Petstore
:'enum_string_required' => :'String', :'enum_string_required' => :'String',
:'enum_integer' => :'Integer', :'enum_integer' => :'Integer',
:'enum_number' => :'Float', :'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 end
# List of attributes with nullable: true # List of attributes with nullable: true
def self.openapi_nullable def self.openapi_nullable
Set.new([ Set.new([
:'outer_enum',
]) ])
end end
@ -108,6 +121,18 @@ module Petstore
if attributes.key?(:'outer_enum') if attributes.key?(:'outer_enum')
self.outer_enum = attributes[:'outer_enum'] self.outer_enum = attributes[:'outer_enum']
end 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 end
# Show invalid properties with the reasons. Usually used together with valid? # Show invalid properties with the reasons. Usually used together with valid?
@ -185,7 +210,10 @@ module Petstore
enum_string_required == o.enum_string_required && enum_string_required == o.enum_string_required &&
enum_integer == o.enum_integer && enum_integer == o.enum_integer &&
enum_number == o.enum_number && 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 end
# @see the `==` method # @see the `==` method
@ -197,7 +225,7 @@ module Petstore
# Calculates hash code according to all attributes. # Calculates hash code according to all attributes.
# @return [Integer] Hash code # @return [Integer] Hash code
def hash 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 end
# Builds the object from hash # Builds the object from hash

View File

@ -40,7 +40,11 @@ module Petstore
attr_accessor :password 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. # Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map def self.attribute_map
@ -58,7 +62,8 @@ module Petstore
:'date_time' => :'dateTime', :'date_time' => :'dateTime',
:'uuid' => :'uuid', :'uuid' => :'uuid',
:'password' => :'password', :'password' => :'password',
:'big_decimal' => :'BigDecimal' :'pattern_with_digits' => :'pattern_with_digits',
:'pattern_with_digits_and_delimiter' => :'pattern_with_digits_and_delimiter'
} }
end end
@ -78,7 +83,8 @@ module Petstore
:'date_time' => :'DateTime', :'date_time' => :'DateTime',
:'uuid' => :'String', :'uuid' => :'String',
:'password' => :'String', :'password' => :'String',
:'big_decimal' => :'BigDecimal' :'pattern_with_digits' => :'String',
:'pattern_with_digits_and_delimiter' => :'String'
} }
end end
@ -155,8 +161,12 @@ module Petstore
self.password = attributes[:'password'] self.password = attributes[:'password']
end end
if attributes.key?(:'big_decimal') if attributes.key?(:'pattern_with_digits')
self.big_decimal = attributes[:'big_decimal'] 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
end end
@ -217,11 +227,6 @@ module Petstore
invalid_properties.push('invalid value for "byte", byte cannot be nil.') invalid_properties.push('invalid value for "byte", byte cannot be nil.')
end 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? if @date.nil?
invalid_properties.push('invalid value for "date", date cannot be nil.') invalid_properties.push('invalid value for "date", date cannot be nil.')
end end
@ -238,6 +243,16 @@ module Petstore
invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.')
end 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 invalid_properties
end end
@ -257,11 +272,12 @@ module Petstore
return false if !@double.nil? && @double < 67.8 return false if !@double.nil? && @double < 67.8
return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i)
return false if @byte.nil? 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 @date.nil?
return false if @password.nil? return false if @password.nil?
return false if @password.to_s.length > 64 return false if @password.to_s.length > 64
return false if @password.to_s.length < 10 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 true
end end
@ -350,21 +366,6 @@ module Petstore
@string = string @string = string
end 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 # Custom attribute writer method with validation
# @param [Object] password Value to be assigned # @param [Object] password Value to be assigned
def password=(password) def password=(password)
@ -383,6 +384,28 @@ module Petstore
@password = password @password = password
end 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. # Checks equality by comparing each attribute.
# @param [Object] Object to be compared # @param [Object] Object to be compared
def ==(o) def ==(o)
@ -401,7 +424,8 @@ module Petstore
date_time == o.date_time && date_time == o.date_time &&
uuid == o.uuid && uuid == o.uuid &&
password == o.password && 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 end
# @see the `==` method # @see the `==` method
@ -413,7 +437,7 @@ module Petstore
# Calculates hash code according to all attributes. # Calculates hash code according to all attributes.
# @return [Integer] Hash code # @return [Integer] Hash code
def hash 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 end
# Builds the object from hash # Builds the object from hash

View File

@ -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<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::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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<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::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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -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<Integer>',
:'name_string' => :'String',
:'name_number' => :'Float',
:'name_integer' => :'Integer',
:'name_boolean' => :'Boolean',
:'name_array' => :'Array<Integer>',
:'name_wrapped_array' => :'Array<Integer>',
:'prefix_string' => :'String',
:'prefix_number' => :'Float',
:'prefix_integer' => :'Integer',
:'prefix_boolean' => :'Boolean',
:'prefix_array' => :'Array<Integer>',
:'prefix_wrapped_array' => :'Array<Integer>',
:'namespace_string' => :'String',
:'namespace_number' => :'Float',
:'namespace_integer' => :'Integer',
:'namespace_boolean' => :'Boolean',
:'namespace_array' => :'Array<Integer>',
:'namespace_wrapped_array' => :'Array<Integer>',
:'prefix_ns_string' => :'String',
:'prefix_ns_number' => :'Float',
:'prefix_ns_integer' => :'Integer',
:'prefix_ns_boolean' => :'Boolean',
:'prefix_ns_array' => :'Array<Integer>',
:'prefix_ns_wrapped_array' => :'Array<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::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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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

View File

@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0 The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.1.3-SNAPSHOT OpenAPI Generator version: 5.0.0-SNAPSHOT
=end =end
@ -35,7 +35,7 @@ describe 'AnotherFakeApi' do
# unit tests for call_123_test_special_tags # unit tests for call_123_test_special_tags
# To test special tags # To test special tags
# To test special tags and operation ID starting with number # To test special tags and operation ID starting with number
# @param body client model # @param client client model
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Client] # @return [Client]
describe 'call_123_test_special_tags test' do describe 'call_123_test_special_tags test' do

View File

@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0 The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.1.3-SNAPSHOT OpenAPI Generator version: 5.0.0-SNAPSHOT
=end =end
@ -32,13 +32,24 @@ describe 'FakeApi' do
end end
end end
# unit tests for create_xml_item # unit tests for fake_health_get
# creates an XmlItem # Health check endpoint
# this route creates an XmlItem
# @param xml_item XmlItem Body
# @param [Hash] opts the optional parameters # @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] # @return [nil]
describe 'create_xml_item test' do describe 'fake_http_signature_test test' do
it 'should work' do it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end end
@ -58,7 +69,7 @@ describe 'FakeApi' do
# unit tests for fake_outer_composite_serialize # unit tests for fake_outer_composite_serialize
# Test serialization of object with outer number type # Test serialization of object with outer number type
# @param [Hash] opts the optional parameters # @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] # @return [OuterComposite]
describe 'fake_outer_composite_serialize test' do describe 'fake_outer_composite_serialize test' do
it 'should work' do it 'should work' do
@ -90,7 +101,7 @@ describe 'FakeApi' do
# unit tests for test_body_with_file_schema # unit tests for test_body_with_file_schema
# For this test, the body for this request much reference a schema named &#x60;File&#x60;. # For this test, the body for this request much reference a schema named &#x60;File&#x60;.
# @param body # @param file_schema_test_class
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'test_body_with_file_schema test' do describe 'test_body_with_file_schema test' do
@ -101,7 +112,7 @@ describe 'FakeApi' do
# unit tests for test_body_with_query_params # unit tests for test_body_with_query_params
# @param query # @param query
# @param body # @param user
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'test_body_with_query_params test' do describe 'test_body_with_query_params test' do
@ -113,7 +124,7 @@ describe 'FakeApi' do
# unit tests for test_client_model # unit tests for test_client_model
# To test \&quot;client\&quot; model # To test \&quot;client\&quot; model
# To test \&quot;client\&quot; model # To test \&quot;client\&quot; model
# @param body client model # @param client client model
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [Client] # @return [Client]
describe 'test_client_model test' do describe 'test_client_model test' do
@ -185,7 +196,7 @@ describe 'FakeApi' do
# unit tests for test_inline_additional_properties # unit tests for test_inline_additional_properties
# test inline additionalProperties # test inline additionalProperties
# @param param request body # @param request_body request body
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'test_inline_additional_properties test' do describe 'test_inline_additional_properties test' do

View File

@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0 The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.1.3-SNAPSHOT OpenAPI Generator version: 5.0.0-SNAPSHOT
=end =end
@ -35,7 +35,7 @@ describe 'FakeClassnameTags123Api' do
# unit tests for test_classname # unit tests for test_classname
# To test class name in snake case # To test class name in snake case
# 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 # @param [Hash] opts the optional parameters
# @return [Client] # @return [Client]
describe 'test_classname test' do describe 'test_classname test' do

View File

@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0 The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.1.3-SNAPSHOT OpenAPI Generator version: 5.0.0-SNAPSHOT
=end =end
@ -34,7 +34,7 @@ describe 'PetApi' do
# unit tests for add_pet # unit tests for add_pet
# Add a new pet to the store # 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'add_pet test' do describe 'add_pet test' do
@ -93,7 +93,7 @@ describe 'PetApi' do
# unit tests for update_pet # unit tests for update_pet
# Update an existing 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'update_pet test' do describe 'update_pet test' do

View File

@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0 The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.1.3-SNAPSHOT OpenAPI Generator version: 5.0.0-SNAPSHOT
=end =end
@ -69,7 +69,7 @@ describe 'StoreApi' do
# unit tests for place_order # unit tests for place_order
# Place an order for a pet # 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 # @param [Hash] opts the optional parameters
# @return [Order] # @return [Order]
describe 'place_order test' do describe 'place_order test' do

View File

@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0 The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.1.3-SNAPSHOT OpenAPI Generator version: 5.0.0-SNAPSHOT
=end =end
@ -35,7 +35,7 @@ describe 'UserApi' do
# unit tests for create_user # unit tests for create_user
# Create user # Create user
# This can only be done by the logged in 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'create_user test' do describe 'create_user test' do
@ -46,7 +46,7 @@ describe 'UserApi' do
# unit tests for create_users_with_array_input # unit tests for create_users_with_array_input
# Creates list of users with given input array # 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'create_users_with_array_input test' do describe 'create_users_with_array_input test' do
@ -57,7 +57,7 @@ describe 'UserApi' do
# unit tests for create_users_with_list_input # unit tests for create_users_with_list_input
# Creates list of users with given input array # 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 # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'create_users_with_list_input test' do describe 'create_users_with_list_input test' do
@ -115,7 +115,7 @@ describe 'UserApi' do
# Updated user # Updated user
# This can only be done by the logged in user. # This can only be done by the logged in user.
# @param username name that need to be deleted # @param username name that need to be deleted
# @param body Updated user object # @param user Updated user object
# @param [Hash] opts the optional parameters # @param [Hash] opts the optional parameters
# @return [nil] # @return [nil]
describe 'update_user test' do describe 'update_user test' do

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More